|
1 | 1 | // swift-tools-version:5.3
|
2 | 2 |
|
3 | 3 | import PackageDescription
|
| 4 | +import Foundation |
| 5 | + |
| 6 | +// When building the toolchain on the CI, don't add the CI's runpath for the |
| 7 | +// final build before installing. |
| 8 | +let sourcekitLSPLinkSettings : [LinkerSetting] |
| 9 | +if ProcessInfo.processInfo.environment["SOURCEKIT_LSP_CI_INSTALL"] != nil { |
| 10 | + sourcekitLSPLinkSettings = [ .unsafeFlags(["-no-toolchain-stdlib-rpath"], .when(platforms: [.linux, .android])) ] |
| 11 | +} else { |
| 12 | + sourcekitLSPLinkSettings = [] |
| 13 | +} |
4 | 14 |
|
5 | 15 | let package = Package(
|
6 | 16 | name: "SourceKitLSP",
|
@@ -36,7 +46,8 @@ let package = Package(
|
36 | 46 | .product(name: "ArgumentParser", package: "swift-argument-parser"),
|
37 | 47 | .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
|
38 | 48 | ],
|
39 |
| - exclude: ["CMakeLists.txt"]), |
| 49 | + exclude: ["CMakeLists.txt"], |
| 50 | + linkerSettings: sourcekitLSPLinkSettings), |
40 | 51 |
|
41 | 52 | .target(
|
42 | 53 | name: "SourceKitLSP",
|
@@ -236,8 +247,6 @@ let package = Package(
|
236 | 247 | // by the external environment. This allows sourcekit-lsp to take advantage of the automation used
|
237 | 248 | // for building the swift toolchain, such as `update-checkout`, or cross-repo PR tests.
|
238 | 249 |
|
239 |
| -import Foundation |
240 |
| - |
241 | 250 | if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
|
242 | 251 | // Building standalone.
|
243 | 252 | package.dependencies += [
|
|
0 commit comments