Skip to content

Commit 25b627d

Browse files
committed
[CMake] Set provided RPATH
1 parent 093474a commit 25b627d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/modules/AddSwiftHostLibrary.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ function(add_swift_syntax_library name)
104104
BUILD_WITH_INSTALL_RPATH YES
105105
)
106106

107+
if(SWIFT_HOST_LIBRARIES_RPATH)
108+
# Don't add builder's stdlib RPATH automatically.
109+
target_compile_options(${name} PRIVATE -no-toolchain-stdlib-rpath)
110+
set_property(TARGET ${name}
111+
PROPERTY INSTALL_RPATH "${SWIFT_HOST_LIBRARIES_RPATH}"
112+
)
113+
endif()
114+
107115
get_target_property(lib_type ${name} TYPE)
108116
if(lib_type STREQUAL SHARED_LIBRARY)
109117
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)

0 commit comments

Comments
 (0)