File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ function(add_pure_swift_host_library name)
163163 add_custom_command (
164164 TARGET ${name}
165165 POST_BUILD
166- COMMAND "${CMAKE_COMMAND} " -E touch_nocreate $<TARGET_FILE:${name} > $<TARGET_OBJECTS:${name} >
166+ COMMAND "${CMAKE_COMMAND} " -E touch_nocreate $<TARGET_FILE:${name} > $<TARGET_OBJECTS:${name} > " ${SWIFT_HOST_LIBRARIES_DEST_DIR} / ${name} .swiftmodule" " ${CMAKE_CURRENT_BINARY_DIR} / ${name} .swiftmodule"
167167 COMMAND_EXPAND_LISTS
168168 COMMENT "Update mtime of library outputs workaround" )
169169
@@ -304,6 +304,24 @@ function(add_pure_swift_host_tool name)
304304 target_include_directories (${name} PUBLIC
305305 ${SWIFT_HOST_LIBRARIES_DEST_DIR} )
306306
307+ # Workaround to touch the library and its objects so that we don't
308+ # continually rebuild (again, see corresponding change in swift-syntax).
309+ add_custom_command (
310+ TARGET ${name}
311+ POST_BUILD
312+ COMMAND "${CMAKE_COMMAND} " -E touch_nocreate $<TARGET_FILE:${name} > $<TARGET_OBJECTS:${name} >
313+ COMMAND_EXPAND_LISTS
314+ COMMENT "Update mtime of executable outputs workaround" )
315+
316+ # Even worse hack - ${name}.swiftmodule is added as an output, even though
317+ # this is an executable target. Just touch it all the time to avoid having
318+ # to rebuild it every time.
319+ add_custom_command (
320+ TARGET ${name}
321+ POST_BUILD
322+ COMMAND "${CMAKE_COMMAND} " -E touch "${CMAKE_CURRENT_BINARY_DIR} /${name} .swiftmodule"
323+ COMMAND_EXPAND_LISTS
324+ COMMENT "Update mtime of executable outputs workaround" )
307325 # Export this target.
308326 set_property (GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name} )
309327endfunction ()
You can’t perform that action at this time.
0 commit comments