@@ -408,6 +408,7 @@ function Get-TargetProjectBinaryCache($Arch, [TargetComponent]$Project) {
408
408
enum HostComponent {
409
409
Compilers = 5
410
410
FoundationMacros = 10
411
+ TestingMacros
411
412
System
412
413
ToolsSupportCore
413
414
LLBuild
@@ -426,7 +427,6 @@ enum HostComponent {
426
427
LMDB
427
428
SymbolKit
428
429
DocC
429
- SwiftTestingMacros
430
430
}
431
431
432
432
function Get-HostProjectBinaryCache ([HostComponent ]$Project ) {
@@ -441,6 +441,7 @@ enum BuildComponent {
441
441
BuildTools
442
442
Compilers
443
443
FoundationMacros
444
+ TestingMacros
444
445
}
445
446
446
447
function Get-BuildProjectBinaryCache ([BuildComponent ]$Project ) {
@@ -1854,8 +1855,7 @@ function Build-SwiftTesting([Platform]$Platform, $Arch, [switch]$Test = $false)
1854
1855
BUILD_SHARED_LIBS = " YES" ;
1855
1856
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
1856
1857
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
1857
- # FIXME: Build the plugin for the builder and specify the path.
1858
- SwiftTesting_MACRO = " NO" ;
1858
+ SwiftTesting_MACRO = " $ ( Get-BuildProjectBinaryCache TestingMacros) \TestingMacros.dll" ;
1859
1859
})
1860
1860
}
1861
1861
}
@@ -2261,16 +2261,48 @@ function Build-SourceKitLSP($Arch) {
2261
2261
}
2262
2262
}
2263
2263
2264
- function Build-SwiftTestingMacros ($Arch ) {
2264
+ function Build-TestingMacros () {
2265
+ [CmdletBinding (PositionalBinding = $false )]
2266
+ param
2267
+ (
2268
+ [Parameter (Position = 0 , Mandatory = $true )]
2269
+ [Platform ]$Platform ,
2270
+ [Parameter (Position = 1 , Mandatory = $true )]
2271
+ [hashtable ]$Arch ,
2272
+ [switch ] $Build = $false
2273
+ )
2274
+
2275
+ $TestingMacrosBinaryCache = if ($Build ) {
2276
+ Get-BuildProjectBinaryCache TestingMacros
2277
+ } else {
2278
+ Get-HostProjectBinaryCache TestingMacros
2279
+ }
2280
+
2281
+ $SwiftSDK = $null
2282
+ if ($Build ) {
2283
+ $SwiftSDK = $HostArch.SDKInstallRoot
2284
+ }
2285
+
2286
+ $Targets = if ($Build ) {
2287
+ @ (" default" )
2288
+ } else {
2289
+ @ (" default" , " install" )
2290
+ }
2291
+
2292
+ $InstallDir = $null
2293
+ if (-not $Build ) {
2294
+ $InstallDir = " $ ( $Arch.ToolchainInstallRoot ) \usr"
2295
+ }
2296
+
2265
2297
Build-CMakeProject `
2266
2298
- Src $SourceCache \swift- testing\Sources\TestingMacros `
2267
- - Bin ( Get-HostProjectBinaryCache SwiftTestingMacros) `
2268
- - InstallTo " $ ( $Arch .ToolchainInstallRoot ) \usr " `
2299
+ - Bin $TestingMacrosBinaryCache `
2300
+ - InstallTo: $InstallDir `
2269
2301
- Arch $Arch `
2270
- - Platform Windows `
2302
+ - Platform $Platform `
2271
2303
- UseBuiltCompilers Swift `
2272
- - SwiftSDK ( Get-HostSwiftSDK ) `
2273
- - BuildTargets default `
2304
+ - SwiftSDK: $SwiftSDK `
2305
+ - BuildTargets $Targets `
2274
2306
- Defines @ {
2275
2307
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2276
2308
}
@@ -2430,7 +2462,9 @@ if (-not $SkipBuild) {
2430
2462
# Build platform: SDK, Redist and XCTest
2431
2463
Invoke-BuildStep Build-Runtime Windows $Arch
2432
2464
Invoke-BuildStep Build-Dispatch Windows $Arch
2465
+ # FIXME(compnerd) ensure that the _build_ is the first arch and don't rebuild on each arch
2433
2466
Invoke-BuildStep Build-FoundationMacros - Build Windows $BuildArch
2467
+ Invoke-BuildStep Build-TestingMacros - Build Windows $BuildArch
2434
2468
Invoke-BuildStep Build-Foundation Windows $Arch
2435
2469
Invoke-BuildStep Build-XCTest Windows $Arch
2436
2470
Invoke-BuildStep Build-SwiftTesting Windows $Arch
@@ -2456,6 +2490,7 @@ if (-not $SkipBuild) {
2456
2490
if (-not $SkipBuild ) {
2457
2491
# Build Macros for distribution
2458
2492
Invoke-BuildStep Build-FoundationMacros Windows $HostArch
2493
+ Invoke-BuildStep Build-TestingMacros Windows $HostArch
2459
2494
}
2460
2495
2461
2496
if (-not $ToBatch ) {
@@ -2477,8 +2512,6 @@ if (-not $ToBatch) {
2477
2512
}
2478
2513
2479
2514
if (-not $SkipBuild ) {
2480
- # TestingMacros can't be built before the standard library for the host as it is required for the Swift code.
2481
- Invoke-BuildStep Build-SwiftTestingMacros $HostArch
2482
2515
Invoke-BuildStep Build-SQLite $HostArch
2483
2516
Invoke-BuildStep Build-System $HostArch
2484
2517
Invoke-BuildStep Build-ToolsSupportCore $HostArch
0 commit comments