Skip to content

Commit f7cd9ab

Browse files
committed
build: tweak the Windows build to build against the internal swift-syntax
Use the internal copy of swift-syntax that the compiler uses for macros to build the LSP. By sharing the swift-syntax build, we shave ~6MiB off the LSP binary. Additionally, we avoid building swift-syntax twice as a single copy is now used.
1 parent 24dc372 commit f7cd9ab

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

utils/build.ps1

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,30 +1467,17 @@ function Build-IndexStoreDB($Arch) {
14671467
}
14681468
}
14691469

1470-
function Build-Syntax($Arch) {
1471-
Build-CMakeProject `
1472-
-Src $SourceCache\swift-syntax `
1473-
-Bin $BinaryCache\14 `
1474-
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
1475-
-Arch $Arch `
1476-
-UseBuiltCompilers Swift `
1477-
-SwiftSDK $SDKInstallRoot `
1478-
-BuildTargets default `
1479-
-Defines @{
1480-
BUILD_SHARED_LIBS = "NO";
1481-
}
1482-
}
1483-
14841470
function Build-SourceKitLSP($Arch) {
14851471
Build-CMakeProject `
14861472
-Src $SourceCache\sourcekit-lsp `
1487-
-Bin $BinaryCache\15 `
1473+
-Bin $BinaryCache\14 `
14881474
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
14891475
-Arch $Arch `
14901476
-UseBuiltCompilers C,Swift `
14911477
-SwiftSDK $SDKInstallRoot `
14921478
-BuildTargets default `
14931479
-Defines @{
1480+
SwiftSyntax_DIR = "$BinaryCache\1\cmake\modules";
14941481
SwiftSystem_DIR = "$BinaryCache\2\cmake\modules";
14951482
TSC_DIR = "$BinaryCache\3\cmake\modules";
14961483
LLBuild_DIR = "$BinaryCache\4\cmake\modules";
@@ -1499,7 +1486,6 @@ function Build-SourceKitLSP($Arch) {
14991486
SwiftCollections_DIR = "$BinaryCache\9\cmake\modules";
15001487
SwiftPM_DIR = "$BinaryCache\12\cmake\modules";
15011488
IndexStoreDB_DIR = "$BinaryCache\13\cmake\modules";
1502-
SwiftSyntax_DIR = "$BinaryCache\14\cmake\modules";
15031489
}
15041490
}
15051491

@@ -1654,7 +1640,6 @@ if (-not $SkipBuild) {
16541640
Invoke-BuildStep Build-Certificates $HostArch
16551641
Invoke-BuildStep Build-PackageManager $HostArch
16561642
Invoke-BuildStep Build-IndexStoreDB $HostArch
1657-
Invoke-BuildStep Build-Syntax $HostArch
16581643
Invoke-BuildStep Build-SourceKitLSP $HostArch
16591644
}
16601645

0 commit comments

Comments
 (0)