File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -195,17 +195,24 @@ function(add_properties_for_swift_modules target reldir)
195195 target_link_libraries (${target} PRIVATE swiftCore-linux-${arch} )
196196 string (TOLOWER ${CMAKE_SYSTEM_NAME} platform)
197197 set (SWIFT_BUILD_RPATH "${LLDB_SWIFT_LIBS} /${platform} " )
198- set (SWIFT_INSTALL_RPATH "$ORIGIN/swift/${platform} " )
198+ set (SWIFT_INSTALL_RPATH "$ORIGIN/${reldir} lib/ swift/${platform} " )
199199 endif ()
200200
201201 set_property (TARGET ${target} APPEND PROPERTY BUILD_RPATH "${SWIFT_BUILD_RPATH} " )
202202 set_property (TARGET ${target} APPEND PROPERTY INSTALL_RPATH "${SWIFT_INSTALL_RPATH} " )
203203
204204 if (SWIFT_SWIFT_PARSER)
205- set_property (TARGET ${target}
206- APPEND PROPERTY BUILD_RPATH "@loader_path/${build_reldir} lib/swift/host" )
207- set_property (TARGET ${target}
208- APPEND PROPERTY INSTALL_RPATH "@loader_path/${reldir} lib/swift/host" )
205+ if (CMAKE_SYSTEM_NAME MATCHES "Darwin" )
206+ set_property (TARGET ${target}
207+ APPEND PROPERTY BUILD_RPATH "@loader_path/${build_reldir} lib/swift/host" )
208+ set_property (TARGET ${target}
209+ APPEND PROPERTY INSTALL_RPATH "@loader_path/${reldir} lib/swift/host" )
210+ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD" )
211+ set_property (TARGET ${target}
212+ APPEND PROPERTY BUILD_RPATH "$ORIGIN/${build_reldir} lib/swift/host" )
213+ set_property (TARGET ${target}
214+ APPEND PROPERTY INSTALL_RPATH "$ORIGIN/${reldir} lib/swift/host" )
215+ endif ()
209216 endif ()
210217 endif ()
211218endfunction ()
Original file line number Diff line number Diff line change @@ -149,7 +149,11 @@ endif()
149149# BEGIN Swift Mods
150150# Note that add_properties_for_swift_modules appends RPATHs so it's critical
151151# that this is called after lldb_setup_rpaths.
152- add_properties_for_swift_modules(liblldb "../../../../../../usr/" "../../../../" )
152+ if (LLDB_BUILD_FRAMEWORK)
153+ add_properties_for_swift_modules(liblldb "../../../../../../usr/" "../../../../" )
154+ else ()
155+ add_properties_for_swift_modules(liblldb "../" )
156+ endif ()
153157# END Swift Mods
154158
155159if (LLDB_ENABLE_PYTHON)
You can’t perform that action at this time.
0 commit comments