The old uuid library was one file containing all the uuids, generated from the psdk headers, which results in all GUIDs being linked, as soon as a single one is used. Also while widl creates DEFINE_GUID() entries in the header files, midl only creates "extern GUID", so this didn't work on MSVC. The new version uses iid files generated from the idl files and some extra C files. This works with both midl and widl, reduces overhead when linking uuids and is much closer to MS uuid lib.

svn path=/branches/cmake-bringup/; revision=50569
This commit is contained in:
Timo Kreuzer 2011-01-30 14:09:38 +00:00
parent ff4324fb98
commit 96abfd1223
27 changed files with 1743 additions and 222 deletions

View file

@ -142,13 +142,19 @@ macro(add_rpc_library TARGET)
endmacro()
macro(generate_idl_iids IDL_FILE)
get_filename_component(FILE ${IDL_FILE} NAME)
if(FILE STREQUAL "${IDL_FILE}")
set(IDL_FILE_FULL "${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}")
else()
set(IDL_FILE_FULL ${IDL_FILE})
endif()
get_includes(INCLUDES)
get_defines(DEFINES)
get_filename_component(NAME ${IDL_FILE} NAME_WE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c
COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_INTERFACE_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${IDL_FILE})
COMMAND ${IDL_COMPILER} ${INCLUDES} ${DEFINES} ${IDL_FLAGS} ${IDL_INTERFACE_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c ${IDL_FILE_FULL}
DEPENDS ${IDL_FILE_FULL})
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${NAME}_i.c PROPERTIES GENERATED TRUE)
endmacro()