@@ -851,6 +851,7 @@ enum Project {
851851  Certificates
852852  System
853853  Subprocess
854+   ToolsProtocols
854855  Build
855856  PackageManager
856857  PackageManagerRuntime
@@ -3446,6 +3447,19 @@ function Build-Subprocess([Hashtable] $Platform) {
34463447    }
34473448}
34483449
3450+ function  Build-ToolsProtocols ([Hashtable ] $Platform ) {
3451+   Build-CMakeProject  ` 
3452+     - Src $SourceCache \swift- tools- protocols ` 
3453+     - Bin (Get-ProjectBinaryCache  $Platform  ToolsProtocols) ` 
3454+     - InstallTo " $ ( $Platform.ToolchainInstallRoot  ) \usr"   ` 
3455+     - Platform $Platform  ` 
3456+     - UseBuiltCompilers C, CXX, Swift ` 
3457+     - SwiftSDK (Get-SwiftSDK  - OS $Platform.OS   - Identifier $Platform.DefaultSDK  ) ` 
3458+     - Defines @ {
3459+       BUILD_SHARED_LIBS  =  " YES"  ;
3460+     }
3461+ }
3462+ 
34493463function  Build-Build ([Hashtable ] $Platform ) {
34503464  #  Use lld to workaround the ARM64 LNK1322 issue: https://github.com/swiftlang/swift/issues/79740
34513465  #  FIXME(hjyamauchi) Have a real fix
@@ -3466,6 +3480,7 @@ function Build-Build([Hashtable] $Platform) {
34663480      SwiftDriver_DIR  =  (Get-ProjectCMakeModules  $Platform  Driver);
34673481      SwiftSystem_DIR  =  (Get-ProjectCMakeModules  $Platform  System);
34683482      TSC_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsSupportCore);
3483+       SwiftToolsProtocols_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsProtocols);
34693484      SQLite3_INCLUDE_DIR  =  " $SourceCache \swift-toolchain-sqlite\Sources\CSQLite\include"  ;
34703485      SQLite3_LIBRARY  =  " $ ( Get-ProjectBinaryCache  $Platform  SQLite) \SQLite3.lib"  ;
34713486    } +  $ArchSpecificOptions )
@@ -3659,6 +3674,7 @@ function Build-PackageManager([Hashtable] $Platform) {
36593674      ArgumentParser_DIR  =  (Get-ProjectCMakeModules  $Platform  ArgumentParser);
36603675      SwiftDriver_DIR  =  (Get-ProjectCMakeModules  $Platform  Driver);
36613676      SwiftBuild_DIR  =  (Get-ProjectCMakeModules  $Platform  Build);
3677+       SwiftToolsProtocols_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsProtocols);
36623678      SwiftCrypto_DIR  =  (Get-ProjectCMakeModules  $Platform  Crypto);
36633679      SwiftCollections_DIR  =  (Get-ProjectCMakeModules  $Platform  Collections);
36643680      SwiftASN1_DIR  =  (Get-ProjectCMakeModules  $Platform  ASN1);
@@ -3812,6 +3828,7 @@ function Build-SourceKitLSP([Hashtable] $Platform) {
38123828      SwiftPM_DIR  =  (Get-ProjectCMakeModules  $Platform  PackageManager);
38133829      LMDB_DIR  =  (Get-ProjectCMakeModules  $Platform  LMDB);
38143830      IndexStoreDB_DIR  =  (Get-ProjectCMakeModules  $Platform  IndexStoreDB);
3831+       SwiftToolsProtocols_DIR  =  (Get-ProjectCMakeModules  $Platform  ToolsProtocols);
38153832    }
38163833}
38173834
@@ -3870,6 +3887,10 @@ function Test-SourceKitLSP {
38703887    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  IndexStoreDB) \Sources\IndexStoreDB_Index\Index.lib" , 
38713888    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  IndexStoreDB) \Sources\IndexStoreDB_LLVMSupport\LLVMSupport.lib" , 
38723889    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  IndexStoreDB) \Sources\IndexStoreDB_Support\Support.lib" , 
3890+     #  swift-tools-protocols
3891+     " -Xswiftc" ,  " -I$ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \swift" , 
3892+     " -Xswiftc" ,  " -I$SourceCache \swift-tools-protocols\Sources\ToolsProtocolsCAtomics\include" , 
3893+     " -Xlinker" ,  " -L$ ( Get-ProjectBinaryCache  $BuildPlatform  ToolsProtocols) \lib" , 
38733894    #  LMDB
38743895    " -Xlinker" ,  " $ ( Get-ProjectBinaryCache  $BuildPlatform  LMDB) \lib\CLMDB.lib" , 
38753896    #  sourcekit-lsp
@@ -4331,6 +4352,7 @@ if (-not $SkipBuild) {
43314352  Invoke-BuildStep  Build-Certificates  $HostPlatform 
43324353  Invoke-BuildStep  Build-System  $HostPlatform 
43334354  Invoke-BuildStep  Build-Subprocess  $HostPlatform 
4355+   Invoke-BuildStep  Build-ToolsProtocols  $HostPlatform 
43344356  Invoke-BuildStep  Build-Build  $HostPlatform 
43354357  Invoke-BuildStep  Build-PackageManager  $HostPlatform 
43364358  Invoke-BuildStep  Build-Markdown  $HostPlatform 
0 commit comments