@@ -851,6 +851,7 @@ enum Project {
851851  Certificates
852852  System
853853  Subprocess
854+   ToolsProtocols
854855  Build
855856  PackageManager
856857  PackageManagerRuntime
@@ -3446,6 +3447,21 @@ function Build-Subprocess([Hashtable] $Platform) {
34463447    }
34473448}
34483449
3450+ function  Build-ToolsProtocols ([Hashtable ] $Platform ) {
3451+   $SDKROOT  =  Get-SwiftSDK  - OS $Platform.OS   - Identifier $Platform.DefaultSDK  
3452+   Build-CMakeProject  ` 
3453+     - Src $SourceCache \swift- tools- protocols ` 
3454+     - Bin (Get-ProjectBinaryCache  $Platform  ToolsProtocols) ` 
3455+     - Platform $Platform  ` 
3456+     - UseBuiltCompilers C, CXX, Swift ` 
3457+     - SwiftSDK $SDKROOT  ` 
3458+     - BuildTargets default  ` 
3459+     - Defines @ {
3460+       BUILD_SHARED_LIBS  =  " NO" 
3461+       CMAKE_STATIC_LIBRARY_PREFIX_Swift  =  " lib" 
3462+     }
3463+ }
3464+ 
34493465function  Build-Build ([Hashtable ] $Platform ) {
34503466  #  Use lld to workaround the ARM64 LNK1322 issue: https://github.com/swiftlang/swift/issues/79740
34513467  #  FIXME(hjyamauchi) Have a real fix
@@ -3466,6 +3482,7 @@ function Build-Build([Hashtable] $Platform) {
34663482      SwiftDriver_DIR  =  (Get-ProjectCMakeModules  $Platform  Driver);
34673483      SwiftSystem_DIR  =  (Get-ProjectCMakeModules  $Platform  System);
34683484      TSC_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsSupportCore);
3485+       SwiftToolsProtocols_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsProtocols);
34693486      SQLite3_INCLUDE_DIR  =  " $SourceCache \swift-toolchain-sqlite\Sources\CSQLite\include" 
34703487      SQLite3_LIBRARY  =  " $ ( Get-ProjectBinaryCache  $Platform  SQLite) \SQLite3.lib" 
34713488    } +  $ArchSpecificOptions )
@@ -3659,6 +3676,7 @@ function Build-PackageManager([Hashtable] $Platform) {
36593676      ArgumentParser_DIR  =  (Get-ProjectCMakeModules  $Platform  ArgumentParser);
36603677      SwiftDriver_DIR  =  (Get-ProjectCMakeModules  $Platform  Driver);
36613678      SwiftBuild_DIR  =  (Get-ProjectCMakeModules  $Platform  Build);
3679+       SwiftToolsProtocols_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsProtocols);
36623680      SwiftCrypto_DIR  =  (Get-ProjectCMakeModules  $Platform  Crypto);
36633681      SwiftCollections_DIR  =  (Get-ProjectCMakeModules  $Platform  Collections);
36643682      SwiftASN1_DIR  =  (Get-ProjectCMakeModules  $Platform  ASN1);
@@ -3812,6 +3830,7 @@ function Build-SourceKitLSP([Hashtable] $Platform) {
38123830      SwiftPM_DIR  =  (Get-ProjectCMakeModules  $Platform  PackageManager);
38133831      LMDB_DIR  =  (Get-ProjectCMakeModules  $Platform  LMDB);
38143832      IndexStoreDB_DIR  =  (Get-ProjectCMakeModules  $Platform  IndexStoreDB);
3833+       SwiftToolsProtocols_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsProtocols);
38153834    }
38163835}
38173836
@@ -3870,6 +3889,14 @@ function Test-SourceKitLSP {
38703889    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  IndexStoreDB) \Sources\IndexStoreDB_Index\Index.lib" , 
38713890    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  IndexStoreDB) \Sources\IndexStoreDB_LLVMSupport\LLVMSupport.lib" , 
38723891    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  IndexStoreDB) \Sources\IndexStoreDB_Support\Support.lib" , 
3892+     #  swift-tools-protocols
3893+     " -Xswiftc" ,  " -I$ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \swift" , 
3894+     " -Xlinker" ,  " -L$ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib" , 
3895+     " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib\libBuildServerProtocol.lib" , 
3896+     " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib\libLanguageServerProtocol.lib" , 
3897+     " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib\libLanguageServerProtocolTransport.lib" , 
3898+     " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib\libSKLogging.lib" , 
3899+     " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib\libToolsProtocolsSwiftExtensions.lib" , 
38733900    #  LMDB
38743901    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  LMDB) \lib\CLMDB.lib" , 
38753902    #  sourcekit-lsp
@@ -4331,6 +4358,7 @@ if (-not $SkipBuild) {
43314358  Invoke-BuildStep  Build-Certificates  $HostPlatform 
43324359  Invoke-BuildStep  Build-System  $HostPlatform 
43334360  Invoke-BuildStep  Build-Subprocess  $HostPlatform 
4361+   Invoke-BuildStep  Build-ToolsProtocols  $HostPlatform 
43344362  Invoke-BuildStep  Build-Build  $HostPlatform 
43354363  Invoke-BuildStep  Build-PackageManager  $HostPlatform 
43364364  Invoke-BuildStep  Build-Markdown  $HostPlatform 
0 commit comments