1 set( CORGUIDS_IDL_SOURCES
15 clrprivappxhosting.idl
18 clrprivruntimebinders.idl
23 #Build for corguids is done in two steps:
24 #1. compile .idl to *_i.c : This is done using custom midl command
25 #2. compile *_i.c to .lib
27 # Get the current list of definitions to pass to midl
28 get_compile_definitions(MIDL_DEFINITIONS)
29 get_include_directories(MIDL_INCLUDE_DIRECTORIES)
32 # Run custom midl command over each idl file
33 FIND_PROGRAM( MIDL midl.exe )
34 foreach(GENERATE_IDL IN LISTS CORGUIDS_IDL_SOURCES)
35 get_filename_component(IDLNAME ${GENERATE_IDL} NAME_WE)
36 set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c)
37 list(APPEND CORGUIDS_SOURCES ${OUT_NAME})
38 add_custom_command(OUTPUT ${OUT_NAME}
39 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}
40 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
41 COMMENT "Compiling ${GENERATE_IDL}")
42 endforeach(GENERATE_IDL)
44 set_source_files_properties(${CORGUIDS_SOURCES}
45 PROPERTIES GENERATED TRUE)
47 # Compile *_i.c as C files
48 add_compile_options(/TC)
52 #The MIDL tool exists for Windows only, so for other systems, we have the prebuilt xxx_i.c files checked in
53 foreach(IDL_SOURCE IN LISTS CORGUIDS_IDL_SOURCES)
54 get_filename_component(IDLNAME ${IDL_SOURCE} NAME_WE)
55 set(C_SOURCE ../pal/prebuilt/idl/${IDLNAME}_i.c)
56 list(APPEND CORGUIDS_SOURCES ${C_SOURCE})
57 endforeach(IDL_SOURCE)
61 # Compile *_i.c to lib
62 add_library(corguids ${CORGUIDS_SOURCES})