| 1 | Author: Danny Milosavljevic <[email protected]>
|
| 2 | Date: 2025-10-20
|
| 3 | Subject: Set RPATH for SourceKit
|
| 4 |
|
| 5 | Set RPATH for SourceKit shared libraries on Linux when BOOTSTRAPPING_MODE is not set.
|
| 6 |
|
| 7 | Without this, libsourcekitdInProc.so has no RPATH and cannot find libdispatch.so
|
| 8 | and libBlocksRuntime.so in lib/swift/linux/.
|
| 9 |
|
| 10 | |
| 11 | |
| 12 | @@ -227,6 +227,10 @@ macro(add_sourcekit_library name)
|
| 13 |
|
| 14 | if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
| 15 | set_target_properties(${name} PROPERTIES INSTALL_NAME_DIR "@rpath")
|
| 16 | + elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
| 17 | + if(NOT RPATH_LIST)
|
| 18 | + set(RPATH_LIST "$ORIGIN/swift/linux")
|
| 19 | + endif()
|
| 20 | endif()
|
| 21 | set_target_properties(${name} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
| 22 | set_target_properties(${name} PROPERTIES INSTALL_RPATH "${RPATH_LIST}")
|