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
56 if(CLR_CMAKE_WARNINGS_ARE_ERRORS)
57 set(PYTHON_WARNING_FLAGS -Wall -Werror)
59 set(PYTHON_WARNING_FLAGS -Wall)
60 endif(CLR_CMAKE_WARNINGS_ARE_ERRORS)
63 COMMENT "Generating Eventing Files"
64 COMMAND ${PYTHON} -B ${PYTHON_WARNING_FLAGS} ${GenEventFilesScript} ${GenEventArgs} --man "${VM_DIR}/ClrEtwAll.man" --exc "${VM_DIR}/ClrEtwAllMeta.lst" --dummy "${GENERATED_INCLUDE_DIR}/etmdummy.h"
65 OUTPUT ${ScriptGeneratedEventFiles}
66 DEPENDS ${GenEventFilesScript} "${VM_DIR}/ClrEtwAll.man" "${VM_DIR}/ClrEtwAllMeta.lst" "${CLR_DIR}/src/scripts/genXplatEventing.py"
69 list (APPEND GeneratedEventFiles
70 ${ScriptGeneratedEventFiles}
74 GeneratedEventingFiles
75 DEPENDS ${GeneratedEventFiles}
78 function(add_library_clr)
80 add_library(${ARGV} ${VERSION_FILE_PATH})
84 add_dependencies(${ARGV0} GeneratedEventingFiles)
85 list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
86 if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
87 set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
91 function(add_executable_clr)
93 add_executable(${ARGV} ${VERSION_FILE_PATH})
95 add_executable(${ARGV})
97 add_dependencies(${ARGV0} GeneratedEventingFiles)
98 list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX)
99 if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1)
100 set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1)
104 if(CLR_CMAKE_PLATFORM_UNIX)
105 if(CLR_CMAKE_PLATFORM_LINUX)
106 if(CLR_CMAKE_PLATFORM_UNIX_AMD64 OR CLR_CMAKE_PLATFORM_UNIX_ARM)
107 add_subdirectory(debug/createdump)
109 endif(CLR_CMAKE_PLATFORM_LINUX)
111 add_subdirectory(ToolBox/SOS/Strike)
113 # Include the dummy c++ include files
114 include_directories("pal/inc/rt/cpp")
116 # This prevents inclusion of standard C compiler headers
117 add_compile_options(-nostdinc)
119 set (NATIVE_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nativeresources)
120 include_directories(${NATIVE_RESOURCE_DIR})
121 set (RC_TO_CPP ${NATIVE_RESOURCE_DIR}/rctocpp.awk)
122 set (PROCESS_RC ${NATIVE_RESOURCE_DIR}/processrc.awk)
123 set (RESOURCE_STRING_HEADER_DIR ${NATIVE_RESOURCE_DIR})
125 # Create a command to create a C++ source file containing an array of
126 # NativeStringResource structs which represent the information from a
127 # given Windows .rc file. The target C++ file path is returned in the
128 # variable specified by the TARGET_FILE parameter.
129 function(build_resources SOURCE TARGET_NAME TARGET_FILE)
131 get_compile_definitions(PREPROCESS_DEFINITIONS)
132 get_include_directories(INCLUDE_DIRECTORIES)
134 set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)
135 set(RESOURCE_ENTRY_ARRAY_CPP ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.cpp)
138 OUTPUT ${RESOURCE_ENTRY_ARRAY_CPP}
139 # Preprocess the windows .rc file
140 COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${INCLUDE_DIRECTORIES} -o ${PREPROCESSED_SOURCE} -x c ${SOURCE}
141 # Convert the preprocessed .rc file to a C++ file which will be used to make a static lib.
142 COMMAND ${AWK} -v name=${TARGET_NAME} -f ${RC_TO_CPP} -f ${PROCESS_RC} ${PREPROCESSED_SOURCE} >${RESOURCE_ENTRY_ARRAY_CPP}
143 DEPENDS ${SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
146 include_directories(${RESOURCE_STRING_HEADER_DIR})
147 set(${TARGET_FILE} ${RESOURCE_ENTRY_ARRAY_CPP} PARENT_SCOPE)
151 add_subdirectory(nativeresources)
152 endif(CLR_CMAKE_PLATFORM_UNIX)
154 add_subdirectory(utilcode)
155 add_subdirectory(gcinfo)
156 add_subdirectory(coreclr)
157 add_subdirectory(jit)
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)