Skip to content

use BUILD_RPATH to make the build more portable #642

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 1 commit into from
May 7, 2021
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
3 changes: 2 additions & 1 deletion Sources/swift-driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ if(CMAKE_VERSION VERSION_LESS 3.17)
get_target_property(ARGPARSE_LIB ArgumentParser LOCATION)
get_filename_component(ARGPARSE_LIB_DIR ${ARGPARSE_LIB} DIRECTORY)

target_link_options(swift-driver PUBLIC "LINKER:-rpath,${CMAKE_LIBRARY_OUTPUT_DIRECTORY},-rpath,${TSC_LIB_DIR},-rpath,${LLBUILD_LIB_DIR},-rpath,${ARGPARSE_LIB_DIR}")
set_target_properties(swift-driver PROPERTEIS
BUILD_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY};${TSC_LIB_DIR};${LLBUILD_LIB_DIR};${ARGPARSE_LIB_DIR})
endif()
7 changes: 4 additions & 3 deletions Sources/swift-help/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ target_link_libraries(swift-help PUBLIC
if(CMAKE_VERSION VERSION_LESS 3.17)
get_target_property(TSC_UTIL_LIB TSCUtility LOCATION)
get_filename_component(TSC_LIB_DIR ${TSC_UTIL_LIB} DIRECTORY)

get_target_property(ARGPARSE_LIB ArgumentParser LOCATION)
get_filename_component(ARGPARSE_LIB_DIR ${ARGPARSE_LIB} DIRECTORY)

target_link_options(swift-help PUBLIC "LINKER:-rpath,${CMAKE_LIBRARY_OUTPUT_DIRECTORY},-rpath,${TSC_LIB_DIR},-rpath,${ARGPARSE_LIB_DIR}")

set_target_properties(swift-help PROPERTIES
BUILD_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY};${TSC_LIB_DIR};${ARGPARSE_LIB_DIR})
endif()