Skip to content

Commit

Permalink
Merge pull request #792 from bnbarham/fix-rpaths
Browse files Browse the repository at this point in the history
Update install to ensure the build directory is not added to the rpath
  • Loading branch information
shahmishal authored and grynspan committed Nov 19, 2024
1 parent 5e6c8a6 commit a9d4675
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 a9d4675

Please sign in to comment.