1
1
include (macCatalystUtils)
2
2
3
3
# Workaround a cmake bug, see the corresponding function in swift-syntax
4
- function (force_target_link_libraries TARGET )
5
- target_link_libraries (${TARGET} ${ARGN} )
6
-
7
- cmake_parse_arguments (ARGS "PUBLIC;PRIVATE;INTERFACE" "" "" ${ARGN} )
8
- foreach (DEPENDENCY ${ARGS_UNPARSED_ARGUMENTS} )
4
+ function (force_add_dependencies TARGET )
5
+ foreach (DEPENDENCY ${ARGN} )
9
6
string (REGEX REPLACE [<>:\"/\\|?*] _ sanitized ${DEPENDENCY} )
10
7
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /forced-${sanitized} -dep.swift
11
8
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR} /forced-${sanitized} -dep.swift
@@ -17,6 +14,13 @@ function(force_target_link_libraries TARGET)
17
14
endforeach ()
18
15
endfunction ()
19
16
17
+ function (force_target_link_libraries TARGET )
18
+ target_link_libraries (${TARGET} ${ARGN} )
19
+
20
+ cmake_parse_arguments (ARGS "PUBLIC;PRIVATE;INTERFACE" "" "" ${ARGN} )
21
+ force_add_dependencies(${TARGET} ${ARGS_UNPARSED_ARGUMENTS} )
22
+ endfunction ()
23
+
20
24
# Add compile options shared between libraries and executables.
21
25
function (_add_host_swift_compile_options name )
22
26
# Avoid introducing an implicit dependency on the string-processing library.
@@ -175,6 +179,9 @@ function(add_pure_swift_host_library name)
175
179
add_dependencies (${name} ${LLVM_COMMON_DEPENDS} )
176
180
endif ()
177
181
182
+ # Depends on all '*.h' files in 'include/module.modulemap'.
183
+ force_add_dependencies(${name} importedHeaderDependencies)
184
+
178
185
# Workaround to touch the library and its objects so that we don't
179
186
# continually rebuild (again, see corresponding change in swift-syntax).
180
187
add_custom_command (
@@ -334,6 +341,9 @@ function(add_pure_swift_host_tool name)
334
341
add_dependencies (${name} ${LLVM_COMMON_DEPENDS} )
335
342
endif ()
336
343
344
+ # Depends on all '*.h' files in 'include/module.modulemap'.
345
+ force_add_dependencies(${name} importedHeaderDependencies)
346
+
337
347
# Link against dependencies.
338
348
target_link_libraries (${name} PUBLIC
339
349
${APSHT_DEPENDENCIES}
0 commit comments