Skip to content

Commit db18a72

Browse files
authored
CMake: make the libswiftCompatibilitySpan symlink relative (#84200)
Currently we create an absolute one -- this prevents to use the partial toolchain before the installation phase (namely for configurations that run Swift tests on a different device than the builder). Addresses rdar://160277259
1 parent 8362997 commit db18a72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
476476
foreach(sdk ${SWIFT_SDKS})
477477
set(lib_dir "${SWIFT_SDK_${sdk}_LIB_SUBDIR}")
478478
set(lib_path "${SWIFTLIB_DIR}/${lib_dir}")
479-
set(compat_lib_name "${lib_path}/libswiftCompatibilitySpan.dylib")
480479

481480
# This doesn't depend on libswiftCore.dylib because we don't actually need
482481
# for it to exist to create the symlink, nor is there any need to recreate
483482
# the symlink if the dylib changes.
484483
add_custom_command_target(unused_var
485484
CUSTOM_TARGET_NAME "swiftCompatibilitySpan-symlink-${lib_dir}"
486-
OUTPUT "${compat_lib_name}"
487-
COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${lib_path}/libswiftCore.dylib" "${compat_lib_name}")
485+
OUTPUT "${lib_path}/libswiftCompatibilitySpan.dylib"
486+
COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "libswiftCore.dylib" "libswiftCompatibilitySpan.dylib"
487+
WORKING_DIRECTORY ${lib_path})
488488
foreach(ARCH ${SWIFT_SDK_${sdk}_ARCHITECTURES})
489489
add_dependencies("swiftCore-${lib_dir}-${ARCH}" "swiftCompatibilitySpan-symlink-${lib_dir}")
490490
endforeach()

0 commit comments

Comments
 (0)