https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7e9fb41b9f6bf9a677651…
commit 7e9fb41b9f6bf9a677651f080853d5f4f50b52e3
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Mon Jan 15 21:04:56 2018 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Jan 20 15:46:25 2018 +0100
[CMAKE/WIDL] Add rudimentary dependency tracking in add_rpcproxy_files
CORE-14204
---
sdk/cmake/widl-support.cmake | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/sdk/cmake/widl-support.cmake b/sdk/cmake/widl-support.cmake
index 30c4c0b966..267459383b 100644
--- a/sdk/cmake/widl-support.cmake
+++ b/sdk/cmake/widl-support.cmake
@@ -45,11 +45,22 @@ function(add_rpcproxy_files)
foreach(FILE ${ARGN})
get_filename_component(NAME ${FILE} NAME_WE)
- list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h
- COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -p -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c -h -H ${NAME}_p.h
${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} native-widl)
+ # Most proxy idl's have names like <proxyname>_<original>.idl
+ # We use this to create a dependency from the proxy to the original idl
+ string(REPLACE "_" ";" SPLIT_FILE ${FILE})
+ list(LENGTH SPLIT_FILE len)
+ unset(EXTRA_DEP)
+ if(len STREQUAL "2")
+ list(GET SPLIT_FILE 1 SPLIT_FILE)
+ if(EXISTS "${REACTOS_SOURCE_DIR}/sdk/include/psdk/${SPLIT_FILE}")
+ set(EXTRA_DEP ${REACTOS_SOURCE_DIR}/sdk/include/psdk/${SPLIT_FILE})
+ endif()
+ endif()
+ list(APPEND IDLS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.h
+ COMMAND native-widl ${INCLUDES} ${DEFINES} ${IDL_FLAGS} -p -o
${CMAKE_CURRENT_BINARY_DIR}/${NAME}_p.c -h -H ${NAME}_p.h
${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${EXTRA_DEP} native-widl)
endforeach()
# Extra pass to generate dlldata