Skip to content

Commit 5c81d67

Browse files
committed
Update install to ensure the build directory is not added to the rpath
This seems to be fine with the existing CMake, but in 3.29 (possibly earlier) the rpath of libTesting still has the build directory. Make sure to remove any existing build rpath.
1 parent 5f166be commit 5c81d67

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)