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