Skip to content

[CMake with Swift] Add toolchain lib path for stage != 0 bootstrapping builds #61323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,12 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
target_link_directories(${target} PRIVATE "${sdk_dir}")

# Include the abi stable system stdlib in our rpath.
set(swift_runtime_rpath "/usr/lib/swift")
set(swift_runtime_rpath "/usr/lib/swift")

# Add in the toolchain directory so we can grab compatibility libraries
get_filename_component(TOOLCHAIN_BIN_DIR ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY)
get_filename_component(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" ABSOLUTE)
target_link_directories(${target} PUBLIC ${TOOLCHAIN_LIB_DIR})
endif()
endif()
endif()
Expand Down
7 changes: 6 additions & 1 deletion tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ function(add_sourcekit_swift_runtime_link_flags target path HAS_SWIFT_MODULES)
target_link_directories(${target} PRIVATE "${sdk_dir}")

# Include the abi stable system stdlib in our rpath.
set(swift_runtime_rpath "/usr/lib/swift")
set(swift_runtime_rpath "/usr/lib/swift")

# Add in the toolchain directory so we can grab compatibility libraries
get_filename_component(TOOLCHAIN_BIN_DIR ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY)
get_filename_component(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" ABSOLUTE)
target_link_directories(${target} PUBLIC ${TOOLCHAIN_LIB_DIR})
endif()
endif()
endif()
Expand Down