Skip to content
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

[5.3][CMake] fix runpath for ELF platforms #547

Merged
merged 1 commit into from
Sep 2, 2020
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
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
"-Xlinker -alias_list -Xlinker ${PROJECT_SOURCE_DIR}/xcodeconfig/libdispatch.aliases")
endif()

if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
set_target_properties(dispatch PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()

if(ENABLE_SWIFT)
add_subdirectory(swift)
endif()
Expand Down
3 changes: 3 additions & 0 deletions src/swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ if(NOT BUILD_SHARED_LIBS)
install(TARGETS DispatchStubs
EXPORT dispatchExports
DESTINATION ${INSTALL_TARGET_DIR})
elseif(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
target_link_options(swiftDispatch PRIVATE "SHELL:-no-toolchain-stdlib-rpath")
set_target_properties(swiftDispatch PROPERTIES INSTALL_RPATH "$ORIGIN")
endif()