Skip to content

Commit e427765

Browse files
committed
Add a sentinel target for perplex generated output
Getting an intermittent failure on Windows where the expscan.h header apparently isn't present on the file system soon enough for the build to succeed (a subsequent reinvocation of the build command does succeed.) Try the standard technique of making another file write depend on the outputs of the header and src file, then define a target depending on that sentinel file and make the obj libraries depend on that target.
1 parent 8dc5dce commit e427765

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

cmake/FindPERPLEX.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ if(NOT COMMAND PERPLEX_TARGET)
227227
set(PERPLEX_${Name}_SRC ${${PVAR_PREFIX}_OUT_SRC_FILE})
228228
set(PERPLEX_${Name}_HDR ${${PVAR_PREFIX}_OUT_HDR_FILE})
229229
set(PERPLEX_${Name}_INCLUDE_DIR ${${PVAR_PREFIX}_WORKING_DIR})
230+
231+
add_custom_command(
232+
OUTPUT ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel
233+
COMMAND ${CMAKE_COMMAND} -E touch ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel
234+
DEPENDS ${${PVAR_PREFIX}_OUT_SRC_FILE} ${${PVAR_PREFIX}_OUT_HDR_FILE}
235+
)
236+
add_custom_target(${Name} DEPENDS ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel)
237+
230238
endmacro(PERPLEX_TARGET)
231239
endif(NOT COMMAND PERPLEX_TARGET)
232240

src/express/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ foreach(_src ${EXPRESS_SOURCES})
6666
add_library(${_objlib} OBJECT ${_src})
6767
add_dependencies(${_objlib} objlib_expscan_c)
6868
add_dependencies(${_objlib} objlib_expparse_c)
69+
if(TARGET ExpScanner)
70+
add_dependencies(${_objlib} ExpScanner)
71+
endif(TARGET ExpScanner)
6972
if(MSVC)
7073
set_property(TARGET ${_objlib} APPEND PROPERTY COMPILE_DEFINITIONS "SC_EXPRESS_DLL_EXPORTS")
7174
set_property(TARGET ${_objlib} APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "SC_EXPRESS_DLL_IMPORTS")

0 commit comments

Comments
 (0)