Fix trigger for tier 1 call counting delay (#17477)
[platform/upstream/coreclr.git] / src / CMakeLists.txt
1 include_directories("inc")
2 include_directories("strongname/inc")
3 include_directories("inc/winrt")
4 include_directories("debug/inc")
5 include_directories("debug/inc/${ARCH_SOURCES_DIR}")
6 include_directories("debug/inc/dump")
7 include_directories("md/inc")
8 include_directories("classlibnative/bcltype")
9 include_directories("classlibnative/cryptography")
10 include_directories("classlibnative/inc")
11 include_directories("${GENERATED_INCLUDE_DIR}")
12
13 if(WIN32 AND FEATURE_EVENT_TRACE)
14     include_directories("${GENERATED_INCLUDE_DIR}/etw")
15 endif(WIN32 AND FEATURE_EVENT_TRACE)
16
17
18 if(CLR_CMAKE_PLATFORM_UNIX)
19   if(CLR_CMAKE_PLATFORM_LINUX)
20     if(CLR_CMAKE_PLATFORM_UNIX_AMD64 OR CLR_CMAKE_PLATFORM_UNIX_ARM)
21       add_subdirectory(debug/createdump)
22     endif()
23   endif(CLR_CMAKE_PLATFORM_LINUX)
24
25   add_subdirectory(ToolBox/SOS/Strike)
26
27   # Include the dummy c++ include files
28   include_directories("pal/inc/rt/cpp")
29
30   # This prevents inclusion of standard C compiler headers
31   add_compile_options(-nostdinc)
32
33   set (NATIVE_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nativeresources)
34   include_directories(${NATIVE_RESOURCE_DIR})
35   set (RC_TO_CPP ${NATIVE_RESOURCE_DIR}/rctocpp.awk)
36   set (PROCESS_RC ${NATIVE_RESOURCE_DIR}/processrc.awk)
37   set (RESOURCE_STRING_HEADER_DIR ${NATIVE_RESOURCE_DIR})
38
39   # Create a command to create a C++ source file containing an array of
40   # NativeStringResource structs which represent the information from a
41   # given Windows .rc file. The target C++ file path is returned in the
42   # variable specified by the TARGET_FILE parameter.
43   function(build_resources SOURCE TARGET_NAME TARGET_FILE)
44
45     get_compile_definitions(PREPROCESS_DEFINITIONS)
46     get_include_directories(INCLUDE_DIRECTORIES)
47
48     set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)
49     set(RESOURCE_ENTRY_ARRAY_CPP ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.cpp)
50
51     add_custom_command(
52       OUTPUT ${RESOURCE_ENTRY_ARRAY_CPP}
53       # Preprocess the windows .rc file
54       COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${INCLUDE_DIRECTORIES} -o ${PREPROCESSED_SOURCE} -x c ${SOURCE}
55       # Convert the preprocessed .rc file to a C++ file which will be used to make a static lib.
56       COMMAND ${AWK} -v name=${TARGET_NAME} -f ${RC_TO_CPP} -f ${PROCESS_RC} ${PREPROCESSED_SOURCE} >${RESOURCE_ENTRY_ARRAY_CPP}
57             DEPENDS ${SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
58     )
59
60     include_directories(${RESOURCE_STRING_HEADER_DIR})
61     set(${TARGET_FILE} ${RESOURCE_ENTRY_ARRAY_CPP} PARENT_SCOPE)
62
63   endfunction()
64
65   add_subdirectory(nativeresources)
66 endif(CLR_CMAKE_PLATFORM_UNIX)
67
68 add_subdirectory(utilcode)
69 add_subdirectory(gcinfo)
70 add_subdirectory(coreclr)
71 add_subdirectory(jit)
72 add_subdirectory(vm)
73 add_subdirectory(md)
74 add_subdirectory(debug)
75 add_subdirectory(inc)
76 add_subdirectory(strongname)
77 add_subdirectory(binder)
78 add_subdirectory(classlibnative)
79 add_subdirectory(dlls)
80 add_subdirectory(ToolBox)
81 add_subdirectory(tools)
82 add_subdirectory(unwinder)
83 add_subdirectory(ildasm)
84 add_subdirectory(ilasm)
85
86 if(WIN32)
87   add_subdirectory(ipcman)
88 endif(WIN32)
89
90 if(CLR_CMAKE_PLATFORM_UNIX)
91     add_subdirectory(palrt)
92 endif(CLR_CMAKE_PLATFORM_UNIX)