Skip to content

Commit 9e17ac3

Browse files
committed
CMake: ensure Swift host tools depends on HostCompatibilityLibs target
At the time I implemented #60728, I did not realize that in all the bootstrapping mode we need to depend on the compatibility libraries we build -- otherwise when targeting a low deployment target we risk failing because we are not able to find such libraries. Addresses rdar://126552386
1 parent 9504de5 commit 9e17ac3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
505505
target_link_directories(${target} PRIVATE "${sdk_dir}")
506506
507507
# A backup in case the toolchain doesn't have one of the compatibility libraries.
508-
target_link_directories(${target} PRIVATE
509-
"${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
508+
target_link_libraries(${target} PUBLIC HostCompatibilityLibs)
510509
511510
# Include the abi stable system stdlib in our rpath.
512511
set(swift_runtime_rpath "/usr/lib/swift")
@@ -518,8 +517,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
518517
target_link_directories(${target} PRIVATE ${bs_lib_dir})
519518
520519
# Required to pick up the built libswiftCompatibility<n>.a libraries
521-
target_link_directories(${target} PRIVATE
522-
"${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
520+
target_link_libraries(${target} PUBLIC HostCompatibilityLibs)
523521
524522
# At runtime link against the built swift libraries from the current
525523
# bootstrapping stage.

0 commit comments

Comments
 (0)