Skip to content

Commit d3b788f

Browse files
authored
[cmake] Add missing dependency between component and its targets (#76596)
`swift_install_in_component` does not create a dependency between its `TARGETS` and the `COMPONENT`, so one has to be created manually. The missing dependency might cause invocations to CMake/Ninja for the `install-*` targets to not build the required files before the installation is performed. Because the normal `build-script` builds the `all` target, this kind of missing dependencies like this are common. This bit of code appeared in #76497 some days ago.
1 parent b3c5bc4 commit d3b788f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/CompilerSwiftSyntax/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ swift_install_in_component(TARGETS ${compiler_swiftsyntax_libs}
5555
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/compiler" COMPONENT compiler-swift-syntax-lib
5656
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host/compiler" COMPONENT compiler-swift-syntax-lib
5757
RUNTIME DESTINATION "bin" COMPONENT compiler-swift-syntax-lib)
58+
add_dependencies(compiler-swift-syntax-lib ${compiler_swiftsyntax_libs})

0 commit comments

Comments
 (0)