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}")
13 # The Following Logic is used to wire up Build dependencies for Generated files in Event Logging
14 # ClrEtwAll.man - Event Schema
15 # ClrEtwAllMeta.lst - MetaData list [provided to ensure Windows Desktop is not broken]
16 # genXplatEventing.py - has the core logic for parsing Event Schema
17 # genWinEtw.py - Uses genXplatEventing to generate Windows Specific ETW Files
18 # clretwallmain.h and etmdummy.h - Provides the Event Logging Functionality to the VM
19 # clrxplatevents.h - Used by clretwallmain.h on Non Windows platform
20 # ClrEtwAll.h - Used by clretwallmain.h on Windows
21 # ClrEtwAll.rc - Used by src/dlls/clretwrc/clretrw.rc on Windows
23 set (ScriptGeneratedEventFiles
24 ${GENERATED_INCLUDE_DIR}/clretwallmain.h
25 ${GENERATED_INCLUDE_DIR}/etmdummy.h
27 set (GeneratedEventFiles)
30 set (GenEventFilesScript "${CLR_DIR}/src/scripts/genWinEtw.py")
31 set (GenEventArgs --eventheader "${GENERATED_INCLUDE_DIR}/ClrEtwAll.h" --macroheader "${GENERATED_INCLUDE_DIR}/clretwallmain.h")
33 list (APPEND ScriptGeneratedEventFiles
34 ${GENERATED_INCLUDE_DIR}/ClrEtwAll.h
37 list (APPEND GeneratedEventFiles
38 ${GENERATED_INCLUDE_DIR}/ClrEtwAll.rc
42 COMMENT "Generating ETW resource Files"
43 COMMAND ${MC} -h ${GENERATED_INCLUDE_DIR} -r ${GENERATED_INCLUDE_DIR} -b -co -um -p FireEtw "${VM_DIR}/ClrEtwAll.man"
44 OUTPUT ${GENERATED_INCLUDE_DIR}/ClrEtwAll.h
45 DEPENDS "${VM_DIR}/ClrEtwAll.man"
48 set (GenEventFilesScript "${CLR_DIR}/src/scripts/genXplatEventing.py")
49 set (GenEventArgs --inc "${GENERATED_INCLUDE_DIR}")
51 list (APPEND ScriptGeneratedEventFiles
52 ${GENERATED_INCLUDE_DIR}/clrxplatevents.h
57 COMMENT "Generating Eventing Files"
58 COMMAND ${PYTHON} -B -Wall -Werror ${GenEventFilesScript} ${GenEventArgs} --man "${VM_DIR}/ClrEtwAll.man" --exc "${VM_DIR}/ClrEtwAllMeta.lst" --dummy "${GENERATED_INCLUDE_DIR}/etmdummy.h"
59 OUTPUT ${ScriptGeneratedEventFiles}
60 DEPENDS ${GenEventFilesScript} "${VM_DIR}/ClrEtwAll.man" "${VM_DIR}/ClrEtwAllMeta.lst" "${CLR_DIR}/src/scripts/genXplatEventing.py"
63 list (APPEND GeneratedEventFiles
64 ${ScriptGeneratedEventFiles}
68 GeneratedEventingFiles
69 DEPENDS ${GeneratedEventFiles}
72 function(add_library_clr)
74 add_library(${ARGV} ${VERSION_FILE_PATH})
78 add_dependencies(${ARGV0} GeneratedEventingFiles)
79 list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
80 if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
81 set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
85 function(add_executable_clr)
87 add_executable(${ARGV} ${VERSION_FILE_PATH})
89 add_executable(${ARGV})
91 add_dependencies(${ARGV0} GeneratedEventingFiles)
92 list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
93 if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
94 set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
98 if(CLR_CMAKE_PLATFORM_UNIX)
99 if(CLR_CMAKE_PLATFORM_LINUX)
100 if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
101 add_subdirectory(debug/createdump)
102 endif(CLR_CMAKE_PLATFORM_UNIX_AMD64)
103 endif(CLR_CMAKE_PLATFORM_LINUX)
105 add_subdirectory(ToolBox/SOS/Strike)
107 # Include the dummy c++ include files
108 include_directories("pal/inc/rt/cpp")
110 # This prevents inclusion of standard C compiler headers
111 add_compile_options(-nostdinc)
113 set (NATIVE_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nativeresources)
114 include_directories(${NATIVE_RESOURCE_DIR})
115 set (RC_TO_CPP ${NATIVE_RESOURCE_DIR}/rctocpp.awk)
116 set (PROCESS_RC ${NATIVE_RESOURCE_DIR}/processrc.awk)
117 set (RESOURCE_STRING_HEADER_DIR ${NATIVE_RESOURCE_DIR})
119 # Create a command to create a C++ source file containing an array of
120 # NativeStringResource structs which represent the information from a
121 # given Windows .rc file. The target C++ file path is returned in the
122 # variable specified by the TARGET_FILE parameter.
123 function(build_resources SOURCE TARGET_NAME TARGET_FILE)
125 get_compile_definitions(PREPROCESS_DEFINITIONS)
126 get_include_directories(INCLUDE_DIRECTORIES)
128 set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)
129 set(RESOURCE_ENTRY_ARRAY_CPP ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.cpp)
132 OUTPUT ${RESOURCE_ENTRY_ARRAY_CPP}
133 # Preprocess the windows .rc file
134 COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${INCLUDE_DIRECTORIES} -o ${PREPROCESSED_SOURCE} -x c ${SOURCE}
135 # Convert the preprocessed .rc file to a C++ file which will be used to make a static lib.
136 COMMAND ${AWK} -v name=${TARGET_NAME} -f ${RC_TO_CPP} -f ${PROCESS_RC} ${PREPROCESSED_SOURCE} >${RESOURCE_ENTRY_ARRAY_CPP}
137 DEPENDS ${SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
140 include_directories(${RESOURCE_STRING_HEADER_DIR})
141 set(${TARGET_FILE} ${RESOURCE_ENTRY_ARRAY_CPP} PARENT_SCOPE)
145 add_subdirectory(nativeresources)
146 endif(CLR_CMAKE_PLATFORM_UNIX)
148 add_subdirectory(utilcode)
149 add_subdirectory(gcinfo)
150 add_subdirectory(coreclr)
151 add_subdirectory(jit)
153 if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/jit32")
154 add_subdirectory(jit32)
160 add_subdirectory(debug)
161 add_subdirectory(inc)
162 add_subdirectory(strongname)
163 add_subdirectory(binder)
164 add_subdirectory(classlibnative)
165 add_subdirectory(dlls)
166 add_subdirectory(ToolBox)
167 add_subdirectory(tools)
168 add_subdirectory(unwinder)
169 add_subdirectory(ildasm)
170 add_subdirectory(ilasm)
173 add_subdirectory(ipcman)
176 if(CLR_CMAKE_PLATFORM_UNIX)
177 add_subdirectory(palrt)
178 endif(CLR_CMAKE_PLATFORM_UNIX)