Skip to content

Commit d4869fd

Browse files
committed
[CMake] Set correct RPATH in add_pure_swift_host_tool
Also, build pure swift library/tool with install RPATH like non Swift things.
1 parent 082e0c5 commit d4869fd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmake/modules/AddPureSwift.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ function(add_pure_swift_host_library name)
137137
add_library(${name} ${libkind} ${APSHL_SOURCES})
138138
_add_host_swift_compile_options(${name})
139139

140+
set_property(TARGET ${name}
141+
PROPERTY BUILD_WITH_INSTALL_RPATH YES)
142+
140143
# Respect LLVM_COMMON_DEPENDS if it is set.
141144
#
142145
# LLVM_COMMON_DEPENDS if a global variable set in ./lib that provides targets
@@ -257,6 +260,13 @@ function(add_pure_swift_host_tool name)
257260
add_executable(${name} ${APSHT_SOURCES})
258261
_add_host_swift_compile_options(${name})
259262

263+
set_property(TARGET ${name}
264+
APPEND PROPERTY INSTALL_RPATH
265+
"@executable_path/../lib/swift/host")
266+
267+
set_property(TARGET ${name}
268+
PROPERTY BUILD_WITH_INSTALL_RPATH YES)
269+
260270
# Respect LLVM_COMMON_DEPENDS if it is set.
261271
#
262272
# LLVM_COMMON_DEPENDS if a global variable set in ./lib that provides targets

0 commit comments

Comments
 (0)