Skip to content

Commit

Permalink
Merge pull request #832 from swiftlang/jgrynspan/fix-rpaths-6.0
Browse files Browse the repository at this point in the history
[6.0] Update install to ensure the build directory is not added to the rpath
  • Loading branch information
shahmishal authored Nov 22, 2024
2 parents 7efdd76 + a9d4675 commit 18c42c1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmake/modules/SwiftModuleInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ function(_swift_testing_install_target module)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(lib_destination_dir "lib/${swift}/${swift_os}/testing")
set_property(TARGET ${module} PROPERTY
INSTALL_RPATH "@loader_path/..")
set_target_properties(${module} PROPERTIES
INSTALL_RPATH "@loader_path/.."
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
else()
set(lib_destination_dir "lib/${swift}/${swift_os}")
set_property(TARGET ${module} PROPERTY
INSTALL_RPATH "$ORIGIN")
set_target_properties(${module} PROPERTIES
INSTALL_RPATH "$ORIGIN"
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
endif()

install(TARGETS ${module}
Expand Down

0 comments on commit 18c42c1

Please sign in to comment.