File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 6
6
# See http://swift.org/LICENSE.txt for license information
7
7
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8
8
9
+ # cmake generation for Swift adds an order only dependency, which matches how C-family languages
10
+ # works. In that case, however, ninja (and presumably other generators) will rebuild on header
11
+ # changes. That's not the case for Swift, and thus if A -> B, A is not being rebuilt when the
12
+ # ABI/API of B changes.
13
+ #
14
+ # For now workaround this by touching a file whenever B is rebuilt and then compiling that file as
15
+ # part of A. Ideally this file would be generated by each of the targets, but that dependency didn't
16
+ # seem to be being tracked.
17
+ #
18
+ # Remove once rdar://102202478 is fixed.
19
+ function (target_link_libraries TARGET )
20
+ cmake_parse_arguments (ARGS "" "" "PUBLIC" ${ARGN} )
21
+
22
+ _target_link_libraries (${TARGET} PUBLIC ${ARGS_PUBLIC} )
23
+ foreach (DEPENDENCY ${ARGS_PUBLIC} )
24
+ add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /forced-${DEPENDENCY}-dep.swift
25
+ COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR} /forced-${DEPENDENCY}-dep.swift
26
+ DEPENDS ${DEPENDENCY}
27
+ )
28
+ target_sources (${TARGET} PRIVATE
29
+ ${CMAKE_CURRENT_BINARY_DIR} /forced-${DEPENDENCY}-dep.swift
30
+ )
31
+ endforeach ()
32
+ endfunction ()
33
+
9
34
add_subdirectory (SwiftBasicFormat )
10
35
add_subdirectory (SwiftSyntax )
11
36
add_subdirectory (SwiftDiagnostics )
You can’t perform that action at this time.
0 commit comments