summaryrefslogtreecommitdiff
path: root/src/inc/CMakeLists.txt
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
committerdotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
commitef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch)
treedee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /src/inc/CMakeLists.txt
downloadcoreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.gz
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.bz2
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.zip
Initial commit to populate CoreCLR repo
[tfs-changeset: 1407945]
Diffstat (limited to 'src/inc/CMakeLists.txt')
-rw-r--r--src/inc/CMakeLists.txt62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt
new file mode 100644
index 0000000000..cdfa7a2dea
--- /dev/null
+++ b/src/inc/CMakeLists.txt
@@ -0,0 +1,62 @@
+set( CORGUIDS_IDL_SOURCES
+ cordebug.idl
+ xcordebug.idl
+ clrdata.idl
+ clrinternal.idl
+ xclrdata.idl
+ corprof.idl
+ corpub.idl
+ ivalidator.idl
+ ivehandler.idl
+ gchost.idl
+ fusionpriv.idl
+ mscorsvc.idl
+ tlbimpexp.idl
+ clrprivappxhosting.idl
+ clrprivbinding.idl
+ clrprivhosting.idl
+ clrprivruntimebinders.idl
+ corsym.idl
+)
+
+if(WIN32)
+#Build for corguids is done in two steps:
+#1. compile .idl to *_i.c : This is done using custom midl command
+#2. compile *_i.c to .lib
+
+# Get the current list of definitions to pass to midl
+get_compile_definitions(MIDL_DEFINITIONS)
+get_include_directories(MIDL_INCLUDE_DIRECTORIES)
+
+
+# Run custom midl command over each idl file
+FIND_PROGRAM( MIDL midl.exe )
+foreach(GENERATE_IDL ${CORGUIDS_IDL_SOURCES})
+ get_filename_component(IDLNAME ${GENERATE_IDL} NAME_WE)
+ set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c)
+ set(CORGUIDS_SOURCES ${CORGUIDS_SOURCES} ${OUT_NAME})
+ add_custom_command(OUTPUT ${OUT_NAME}
+ COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
+ COMMENT "Compiling ${GENERATE_IDL}")
+endforeach(GENERATE_IDL)
+
+set_source_files_properties(${CORGUIDS_SOURCES}
+ PROPERTIES GENERATED TRUE)
+
+# Compile *_i.c as C files
+add_compile_options(/TC)
+
+else(WIN32)
+
+#The MIDL tool exists for Windows only, so for other systems, we have the prebuilt xxx_i.c files checked in
+foreach(IDL_SOURCE ${CORGUIDS_IDL_SOURCES})
+ get_filename_component(IDLNAME ${IDL_SOURCE} NAME_WE)
+ set(C_SOURCE ../pal/prebuilt/idl/${IDLNAME}_i.c)
+ set(CORGUIDS_SOURCES ${CORGUIDS_SOURCES} ${C_SOURCE})
+endforeach(IDL_SOURCE)
+
+endif(WIN32)
+
+# Compile *_i.c to lib
+add_library(corguids ${CORGUIDS_SOURCES})