@@ -238,6 +238,8 @@ $ArchX64 = @{
238
238
ToolchainInstallRoot = " $BinaryCache \x64\toolchains\$ProductVersion +Asserts" ;
239
239
}
240
240
241
+ $WindowsX64 = $ArchX64
242
+
241
243
$ArchX86 = @ {
242
244
VSName = " x86" ;
243
245
ShortName = " x86" ;
@@ -253,6 +255,8 @@ $ArchX86 = @{
253
255
SwiftTestingInstallRoot = " $BinaryCache \x86\Windows.platform\Developer\Library\Testing-development" ;
254
256
}
255
257
258
+ $WindowsX86 = $ArchX86
259
+
256
260
$ArchARM64 = @ {
257
261
VSName = " arm64" ;
258
262
ShortName = " arm64" ;
@@ -269,6 +273,8 @@ $ArchARM64 = @{
269
273
SwiftTestingInstallRoot = " $BinaryCache \arm64\Windows.platform\Developer\Library\Testing-development" ;
270
274
}
271
275
276
+ $WindowsARM64 = $ArchARM64
277
+
272
278
$AndroidARM64 = @ {
273
279
AndroidArchABI = " arm64-v8a" ;
274
280
BinaryDir = " bin64a" ;
@@ -433,7 +439,7 @@ function Get-TargetProjectBinaryCache($Arch, [TargetComponent]$Project) {
433
439
}
434
440
435
441
enum HostComponent {
436
- Compilers = 5
442
+ Compilers = 9
437
443
FoundationMacros = 10
438
444
TestingMacros
439
445
System
@@ -466,6 +472,7 @@ function Get-HostProjectCMakeModules([HostComponent]$Project) {
466
472
467
473
enum BuildComponent {
468
474
BuildTools
475
+ Driver
469
476
Compilers
470
477
FoundationMacros
471
478
TestingMacros
@@ -1454,6 +1461,7 @@ function Build-Compilers() {
1454
1461
Python3_ROOT_DIR = " $BinaryCache \Python$ ( $Arch.CMakeName ) -$PythonVersion \tools" ;
1455
1462
SWIFT_BUILD_SWIFT_SYNTAX = " YES" ;
1456
1463
SWIFT_CLANG_LOCATION = (Get-PinnedToolchainTool );
1464
+ SWIFT_EARLY_SWIFT_DRIVER_BUILD = " $ ( Get-BuildProjectBinaryCache Driver) \$ ( $BuildArch.LLVMTarget ) \release" ;
1457
1465
SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY = " YES" ;
1458
1466
SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP = " YES" ;
1459
1467
SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING = " YES" ;
@@ -1836,28 +1844,17 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
1836
1844
$ShortArch = $Arch.LLVMName
1837
1845
1838
1846
Isolate- EnvVars {
1839
- $SDKRoot = if ($Platform -eq " Windows" ) {
1840
- " "
1841
- } else {
1842
- (Get-Variable " ${Platform} $ ( $Arch.ShortName ) " - ValueOnly).SDKInstallRoot
1843
- }
1844
-
1845
- $SDKRoot = if ($Platform -eq " Windows" ) {
1846
- " "
1847
- } else {
1848
- (Get-Variable " ${Platform} $ ( $Arch.ShortName ) " - ValueOnly).SDKInstallRoot
1849
- }
1850
-
1851
1847
Build-CMakeProject `
1852
1848
- Src $SourceCache \swift- corelibs- foundation `
1853
1849
- Bin $FoundationBinaryCache `
1854
1850
- InstallTo " $ ( $Arch.SDKInstallRoot ) \usr" `
1855
1851
- Arch $Arch `
1856
1852
- Platform $Platform `
1857
1853
- UseBuiltCompilers ASM, C, CXX, Swift `
1858
- - SwiftSDK: $SDKRoot `
1854
+ - SwiftSDK $ (( Get-Variable " ${Platform} $ ( $Arch .ShortName ) " - ValueOnly).SDKInstallRoot) `
1859
1855
- Defines (@ {
1860
1856
ENABLE_TESTING = " NO" ;
1857
+ CMAKE_Swift_COMPILER_USE_OLD_DRIVER = " YES" ;
1861
1858
FOUNDATION_BUILD_TOOLS = if ($Platform -eq " Windows" ) { " YES" } else { " NO" };
1862
1859
CURL_DIR = " $LibraryRoot \curl-8.9.1\usr\lib\$Platform \$ShortArch \cmake\CURL" ;
1863
1860
LIBXML2_LIBRARY = if ($Platform -eq " Windows" ) {
@@ -1963,6 +1960,7 @@ function Build-XCTest([Platform]$Platform, $Arch, [switch]$Test = $false) {
1963
1960
- Arch $Arch `
1964
1961
- Platform $Platform `
1965
1962
- UseBuiltCompilers Swift `
1963
+ - SwiftSDK $ ((Get-Variable " ${Platform} $ ( $Arch.ShortName ) " - ValueOnly).SDKInstallRoot) `
1966
1964
- BuildTargets $Targets `
1967
1965
- Defines (@ {
1968
1966
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
@@ -1992,6 +1990,7 @@ function Build-Testing([Platform]$Platform, $Arch, [switch]$Test = $false) {
1992
1990
- Arch $Arch `
1993
1991
- Platform $Platform `
1994
1992
- UseBuiltCompilers C, CXX, Swift `
1993
+ - SwiftSDK $ ((Get-Variable " ${Platform} $ ( $Arch.ShortName ) " - ValueOnly).SDKInstallRoot) `
1995
1994
- Defines (@ {
1996
1995
BUILD_SHARED_LIBS = " YES" ;
1997
1996
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
@@ -2217,29 +2216,79 @@ function Build-ArgumentParser($Arch) {
2217
2216
}
2218
2217
}
2219
2218
2220
- function Build-Driver ($Arch ) {
2221
- Build-CMakeProject `
2222
- - Src $SourceCache \swift- driver `
2223
- - Bin (Get-HostProjectBinaryCache Driver) `
2224
- - InstallTo " $ ( $Arch.ToolchainInstallRoot ) \usr" `
2225
- - Arch $Arch `
2226
- - Platform Windows `
2227
- - UseBuiltCompilers C, CXX, Swift `
2228
- - SwiftSDK (Get-HostSwiftSDK ) `
2229
- - Defines @ {
2230
- BUILD_SHARED_LIBS = " YES" ;
2231
- SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
2232
- TSC_DIR = (Get-HostProjectCMakeModules ToolsSupportCore);
2233
- LLBuild_DIR = (Get-HostProjectCMakeModules LLBuild);
2234
- Yams_DIR = (Get-HostProjectCMakeModules Yams);
2235
- ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
2236
- SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0\usr\include" ;
2237
- SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0\usr\lib\SQLite3.lib" ;
2238
- SWIFT_DRIVER_BUILD_TOOLS = " YES" ;
2239
- LLVM_DIR = " $ ( Get-HostProjectBinaryCache Compilers) \lib\cmake\llvm" ;
2240
- Clang_DIR = " $ ( Get-HostProjectBinaryCache Compilers) \lib\cmake\clang" ;
2241
- Swift_DIR = " $ ( Get-HostProjectBinaryCache Compilers) \tools\swift\lib\cmake\swift" ;
2219
+ function Build-Driver () {
2220
+ [CmdletBinding (PositionalBinding = $false )]
2221
+ param
2222
+ (
2223
+ [Parameter (Position = 0 , Mandatory = $true )]
2224
+ [hashtable ]$Arch ,
2225
+ [switch ] $Build = $false
2226
+ )
2227
+
2228
+ if ($Build ) {
2229
+ $Stopwatch = [Diagnostics.Stopwatch ]::StartNew()
2230
+
2231
+ Isolate- EnvVars {
2232
+ $env: SWIFTCI_USE_LOCAL_DEPS = 1
2233
+ $env: SDKROOT = (Get-PinnedToolchainSDK )
2234
+ $env: Path = " $ ( Get-PinnedToolchainRuntime ) ;$ ( Get-PinnedToolchainTool ) ;${env: Path} "
2235
+
2236
+ $src = " $SourceCache \swift-driver"
2237
+ $dst = (Get-BuildProjectBinaryCache Driver)
2238
+
2239
+ if ($ToBatch ) {
2240
+ Write-Output " "
2241
+ Write-Output " echo Building '$src ' to '$dst ' for arch '$ ( $Arch.LLVMName ) '..."
2242
+ } else {
2243
+ Write-Host - ForegroundColor Cyan " [$ ( [DateTime ]::Now.ToString(" yyyy-MM-dd HH:mm:ss" )) ] Building '$src ' to '$dst ' for arch '$ ( $Arch.LLVMName ) '..."
2244
+ }
2245
+
2246
+ Invoke-Program `
2247
+ " $ ( Get-PinnedToolchainTool ) \swift.exe" build `
2248
+ - c release `
2249
+ -- scratch- path $dst `
2250
+ -- package- path $src `
2251
+ - Xcc - Xclang - Xcc - fno- split-cold - code `
2252
+ - Xlinker " $ ( Get-PinnedToolchainSDK ) \usr\lib\swift\windows\$ ( $BuildArch.LLVMName ) \swiftCore.lib"
2253
+
2254
+ if (-not $ToBatch ) {
2255
+ Write-Host - ForegroundColor Cyan " [$ ( [DateTime ]::Now.ToString(" yyyy-MM-dd HH:mm:ss" )) ] Finished building '$src ' to '$dst ' for arch '$ ( $Arch.LLVMName ) ' in $ ( $Stopwatch.Elapsed ) "
2256
+ Write-Host " "
2257
+ }
2258
+
2259
+ if ($Summary ) {
2260
+ $TimingData.Add ([PSCustomObject ]@ {
2261
+ Arch = $BuildArch.LLVMName
2262
+ Checkout = $src.Replace ($SourceCache , ' ' )
2263
+ Platform = " Windows"
2264
+ " Elapsed Time" = $Stopwatch.Elapsed.ToString ()
2265
+ })
2266
+ }
2242
2267
}
2268
+ } else {
2269
+ Build-CMakeProject `
2270
+ - Src $SourceCache \swift- driver `
2271
+ - Bin (Get-HostProjectBinaryCache Driver) `
2272
+ - InstallTo " $ ( $Arch.ToolchainInstallRoot ) \usr" `
2273
+ - Arch $Arch `
2274
+ - Platform Windows `
2275
+ - UseBuiltCompilers C, CXX, Swift `
2276
+ - SwiftSDK (Get-HostSwiftSDK ) `
2277
+ - Defines @ {
2278
+ BUILD_SHARED_LIBS = " YES" ;
2279
+ SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
2280
+ TSC_DIR = (Get-HostProjectCMakeModules ToolsSupportCore);
2281
+ LLBuild_DIR = (Get-HostProjectCMakeModules LLBuild);
2282
+ Yams_DIR = (Get-HostProjectCMakeModules Yams);
2283
+ ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
2284
+ SQLite3_INCLUDE_DIR = " $LibraryRoot \sqlite-3.46.0\usr\include" ;
2285
+ SQLite3_LIBRARY = " $LibraryRoot \sqlite-3.46.0\usr\lib\SQLite3.lib" ;
2286
+ SWIFT_DRIVER_BUILD_TOOLS = " YES" ;
2287
+ LLVM_DIR = " $ ( Get-HostProjectBinaryCache Compilers) \lib\cmake\llvm" ;
2288
+ Clang_DIR = " $ ( Get-HostProjectBinaryCache Compilers) \lib\cmake\clang" ;
2289
+ Swift_DIR = " $ ( Get-HostProjectBinaryCache Compilers) \tools\swift\lib\cmake\swift" ;
2290
+ }
2291
+ }
2243
2292
}
2244
2293
2245
2294
function Build-Crypto ($Arch ) {
@@ -2593,6 +2642,7 @@ Fetch-Dependencies
2593
2642
if (-not $SkipBuild ) {
2594
2643
Invoke-BuildStep Build-CMark $BuildArch
2595
2644
Invoke-BuildStep Build-BuildTools $BuildArch
2645
+ Invoke-BuildStep Build-Driver - Build $BuildArch
2596
2646
if ($IsCrossCompiling ) {
2597
2647
Invoke-BuildStep Build-Compilers - Build $BuildArch
2598
2648
}
0 commit comments