Build tests in gbs for x86/x64 (#307)
[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     add_subdirectory(debug/createdump)
21   endif(CLR_CMAKE_PLATFORM_LINUX)
22
23   # Include the dummy c++ include files
24   include_directories("pal/inc/rt/cpp")
25
26   # This prevents inclusion of standard C compiler headers
27   add_compile_options(-nostdinc)
28
29   set (NATIVE_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nativeresources)
30   include_directories(${NATIVE_RESOURCE_DIR})
31   set (RC_TO_CPP ${NATIVE_RESOURCE_DIR}/rctocpp.awk)
32   set (PROCESS_RC ${NATIVE_RESOURCE_DIR}/processrc.awk)
33   set (RESOURCE_STRING_HEADER_DIR ${NATIVE_RESOURCE_DIR})
34
35   # Create a command to create a C++ source file containing an array of
36   # NativeStringResource structs which represent the information from a
37   # given Windows .rc file. The target C++ file path is returned in the
38   # variable specified by the TARGET_FILE parameter.
39   function(build_resources SOURCE TARGET_NAME TARGET_FILE)
40
41     get_compile_definitions(PREPROCESS_DEFINITIONS)
42     get_include_directories(INCLUDE_DIRECTORIES)
43
44     set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)
45     set(RESOURCE_ENTRY_ARRAY_CPP ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.cpp)
46
47     add_custom_command(
48       OUTPUT ${RESOURCE_ENTRY_ARRAY_CPP}
49       # Preprocess the windows .rc file
50       COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${INCLUDE_DIRECTORIES} -o ${PREPROCESSED_SOURCE} -x c ${SOURCE}
51       # Convert the preprocessed .rc file to a C++ file which will be used to make a static lib.
52       COMMAND ${AWK} -v name=${TARGET_NAME} -f ${RC_TO_CPP} -f ${PROCESS_RC} ${PREPROCESSED_SOURCE} >${RESOURCE_ENTRY_ARRAY_CPP}
53             DEPENDS ${SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
54     )
55
56     include_directories(${RESOURCE_STRING_HEADER_DIR})
57     set(${TARGET_FILE} ${RESOURCE_ENTRY_ARRAY_CPP} PARENT_SCOPE)
58
59   endfunction()
60
61   add_subdirectory(nativeresources)
62 endif(CLR_CMAKE_PLATFORM_UNIX)
63
64 add_subdirectory(utilcode)
65 add_subdirectory(gcinfo)
66 add_subdirectory(coreclr)
67 add_subdirectory(jit)
68 add_subdirectory(vm)
69 add_subdirectory(md)
70 add_subdirectory(debug)
71 add_subdirectory(inc)
72 add_subdirectory(strongname)
73 add_subdirectory(binder)
74 add_subdirectory(classlibnative)
75 add_subdirectory(dlls)
76 add_subdirectory(ToolBox)
77 add_subdirectory(tools)
78 add_subdirectory(unwinder)
79 add_subdirectory(ildasm)
80 add_subdirectory(ilasm)
81
82 if(CLR_CMAKE_PLATFORM_UNIX)
83     add_subdirectory(palrt)
84 endif(CLR_CMAKE_PLATFORM_UNIX)