Skip to content

Commit 51805c4

Browse files
authored
Merge pull request #792 from bnbarham/fix-rpaths
Update install to ensure the build directory is not added to the rpath
2 parents 97d4c18 + 5c81d67 commit 51805c4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: cmake/modules/SwiftModuleInstallation.cmake

+6-4
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ function(_swift_testing_install_target module)
4646
target_compile_options(Testing PRIVATE "-no-toolchain-stdlib-rpath")
4747

4848
if(APPLE)
49-
set_property(TARGET ${module} PROPERTY
50-
INSTALL_RPATH "@loader_path/..")
49+
set_target_properties(${module} PROPERTIES
50+
INSTALL_RPATH "@loader_path/.."
51+
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
5152
else()
52-
set_property(TARGET ${module} PROPERTY
53-
INSTALL_RPATH "$ORIGIN")
53+
set_target_properties(${module} PROPERTIES
54+
INSTALL_RPATH "$ORIGIN"
55+
INSTALL_REMOVE_ENVIRONMENT_RPATH ON)
5456
endif()
5557

5658
get_target_property(type ${module} TYPE)

0 commit comments

Comments
 (0)