Skip to content

Commit a9d4675

Browse files
shahmishalgrynspan
authored andcommitted
Merge pull request #792 from bnbarham/fix-rpaths
Update install to ensure the build directory is not added to the rpath
1 parent 5e6c8a6 commit a9d4675

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmake/modules/SwiftModuleInstallation.cmake

+6-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ function(_swift_testing_install_target module)
3232

3333
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
3434
set(lib_destination_dir "lib/${swift}/${swift_os}/testing")
35-
set_property(TARGET ${module} PROPERTY
36-
INSTALL_RPATH "@loader_path/..")
35+
set_target_properties(${module} PROPERTIES
36+
INSTALL_RPATH "@loader_path/.."
37+
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
3738
else()
3839
set(lib_destination_dir "lib/${swift}/${swift_os}")
39-
set_property(TARGET ${module} PROPERTY
40-
INSTALL_RPATH "$ORIGIN")
40+
set_target_properties(${module} PROPERTIES
41+
INSTALL_RPATH "$ORIGIN"
42+
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
4143
endif()
4244

4345
install(TARGETS ${module}

0 commit comments

Comments
 (0)