@@ -407,6 +407,7 @@ function Get-TargetProjectBinaryCache($Arch, [TargetComponent]$Project) {
407
407
enum HostComponent {
408
408
Compilers = 5
409
409
FoundationMacros = 10
410
+ TestingMacros
410
411
System
411
412
ToolsSupportCore
412
413
LLBuild
@@ -425,7 +426,6 @@ enum HostComponent {
425
426
LMDB
426
427
SymbolKit
427
428
DocC
428
- SwiftTestingMacros
429
429
}
430
430
431
431
function Get-HostProjectBinaryCache ([HostComponent ]$Project ) {
@@ -440,6 +440,7 @@ enum BuildComponent {
440
440
BuildTools
441
441
Compilers
442
442
FoundationMacros
443
+ TestingMacros
443
444
}
444
445
445
446
function Get-BuildProjectBinaryCache ([BuildComponent ]$Project ) {
@@ -1843,8 +1844,7 @@ function Build-SwiftTesting([Platform]$Platform, $Arch, [switch]$Test = $false)
1843
1844
BUILD_SHARED_LIBS = " YES" ;
1844
1845
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
1845
1846
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
1846
- # FIXME: Build the plugin for the builder and specify the path.
1847
- SwiftTesting_MACRO = " NO" ;
1847
+ SwiftTesting_MACRO = " $ ( Get-BuildProjectBinaryCache TestingMacros) \TestingMacros.dll" ;
1848
1848
})
1849
1849
}
1850
1850
}
@@ -2250,16 +2250,48 @@ function Build-SourceKitLSP($Arch) {
2250
2250
}
2251
2251
}
2252
2252
2253
- function Build-SwiftTestingMacros ($Arch ) {
2253
+ function Build-TestingMacros () {
2254
+ [CmdletBinding (PositionalBinding = $false )]
2255
+ param
2256
+ (
2257
+ [Parameter (Position = 0 , Mandatory = $true )]
2258
+ [Platform ]$Platform ,
2259
+ [Parameter (Position = 1 , Mandatory = $true )]
2260
+ [hashtable ]$Arch ,
2261
+ [switch ] $Build = $false
2262
+ )
2263
+
2264
+ $TestingMacrosBinaryCache = if ($Build ) {
2265
+ Get-BuildProjectBinaryCache TestingMacros
2266
+ } else {
2267
+ Get-HostProjectBinaryCache TestingMacros
2268
+ }
2269
+
2270
+ $SwiftSDK = $null
2271
+ if ($Build ) {
2272
+ $SwiftSDK = $HostArch.SDKInstallRoot
2273
+ }
2274
+
2275
+ $Targets = if ($Build ) {
2276
+ @ (" default" )
2277
+ } else {
2278
+ @ (" default" , " install" )
2279
+ }
2280
+
2281
+ $InstallDir = $null
2282
+ if (-not $Build ) {
2283
+ $InstallDir = " $ ( $Arch.ToolchainInstallRoot ) \usr"
2284
+ }
2285
+
2254
2286
Build-CMakeProject `
2255
2287
- Src $SourceCache \swift- testing\Sources\TestingMacros `
2256
- - Bin ( Get-HostProjectBinaryCache SwiftTestingMacros) `
2257
- - InstallTo " $ ( $Arch .ToolchainInstallRoot ) \usr " `
2288
+ - Bin $TestingMacrosBinaryCache `
2289
+ - InstallTo: $InstallDir `
2258
2290
- Arch $Arch `
2259
- - Platform Windows `
2291
+ - Platform $Platform `
2260
2292
- UseBuiltCompilers Swift `
2261
- - SwiftSDK ( Get-HostSwiftSDK ) `
2262
- - BuildTargets default `
2293
+ - SwiftSDK: $SwiftSDK `
2294
+ - BuildTargets $Targets `
2263
2295
- Defines @ {
2264
2296
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2265
2297
}
@@ -2419,7 +2451,9 @@ if (-not $SkipBuild) {
2419
2451
# Build platform: SDK, Redist and XCTest
2420
2452
Invoke-BuildStep Build-Runtime Windows $Arch
2421
2453
Invoke-BuildStep Build-Dispatch Windows $Arch
2454
+ # FIXME(compnerd) ensure that the _build_ is the first arch and don't rebuild on each arch
2422
2455
Invoke-BuildStep Build-FoundationMacros - Build Windows $BuildArch
2456
+ Invoke-BuildStep Build-TestingMacros - Build Windows $BuildArch
2423
2457
Invoke-BuildStep Build-Foundation Windows $Arch
2424
2458
Invoke-BuildStep Build-XCTest Windows $Arch
2425
2459
Invoke-BuildStep Build-SwiftTesting Windows $Arch
@@ -2445,6 +2479,7 @@ if (-not $SkipBuild) {
2445
2479
if (-not $SkipBuild ) {
2446
2480
# Build Macros for distribution
2447
2481
Invoke-BuildStep Build-FoundationMacros Windows $HostArch
2482
+ Invoke-BuildStep Build-TestingMacros Windows $HostArch
2448
2483
}
2449
2484
2450
2485
if (-not $ToBatch ) {
@@ -2466,8 +2501,6 @@ if (-not $ToBatch) {
2466
2501
}
2467
2502
2468
2503
if (-not $SkipBuild ) {
2469
- # TestingMacros can't be built before the standard library for the host as it is required for the Swift code.
2470
- Invoke-BuildStep Build-SwiftTestingMacros $HostArch
2471
2504
Invoke-BuildStep Build-SQLite $HostArch
2472
2505
Invoke-BuildStep Build-System $HostArch
2473
2506
Invoke-BuildStep Build-ToolsSupportCore $HostArch
0 commit comments