@@ -407,6 +407,7 @@ function Get-TargetProjectBinaryCache($Arch, [TargetComponent]$Project) {
407407enum HostComponent {
408408 Compilers = 5
409409 FoundationMacros = 10
410+ TestingMacros
410411 System
411412 ToolsSupportCore
412413 LLBuild
@@ -425,7 +426,6 @@ enum HostComponent {
425426 LMDB
426427 SymbolKit
427428 DocC
428- SwiftTestingMacros
429429}
430430
431431function Get-HostProjectBinaryCache ([HostComponent ]$Project ) {
@@ -440,6 +440,7 @@ enum BuildComponent {
440440 BuildTools
441441 Compilers
442442 FoundationMacros
443+ TestingMacros
443444}
444445
445446function Get-BuildProjectBinaryCache ([BuildComponent ]$Project ) {
@@ -1843,8 +1844,7 @@ function Build-SwiftTesting([Platform]$Platform, $Arch, [switch]$Test = $false)
18431844 BUILD_SHARED_LIBS = " YES" ;
18441845 CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
18451846 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" ;
18481848 })
18491849 }
18501850}
@@ -2250,16 +2250,48 @@ function Build-SourceKitLSP($Arch) {
22502250 }
22512251}
22522252
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+
22542286 Build-CMakeProject `
22552287 - Src $SourceCache \swift- testing\Sources\TestingMacros `
2256- - Bin ( Get-HostProjectBinaryCache SwiftTestingMacros) `
2257- - InstallTo " $ ( $Arch .ToolchainInstallRoot ) \usr " `
2288+ - Bin $TestingMacrosBinaryCache `
2289+ - InstallTo: $InstallDir `
22582290 - Arch $Arch `
2259- - Platform Windows `
2291+ - Platform $Platform `
22602292 - UseBuiltCompilers Swift `
2261- - SwiftSDK ( Get-HostSwiftSDK ) `
2262- - BuildTargets default `
2293+ - SwiftSDK: $SwiftSDK `
2294+ - BuildTargets $Targets `
22632295 - Defines @ {
22642296 SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
22652297 }
@@ -2419,7 +2451,9 @@ if (-not $SkipBuild) {
24192451 # Build platform: SDK, Redist and XCTest
24202452 Invoke-BuildStep Build-Runtime Windows $Arch
24212453 Invoke-BuildStep Build-Dispatch Windows $Arch
2454+ # FIXME(compnerd) ensure that the _build_ is the first arch and don't rebuild on each arch
24222455 Invoke-BuildStep Build-FoundationMacros - Build Windows $BuildArch
2456+ Invoke-BuildStep Build-TestingMacros - Build Windows $BuildArch
24232457 Invoke-BuildStep Build-Foundation Windows $Arch
24242458 Invoke-BuildStep Build-XCTest Windows $Arch
24252459 Invoke-BuildStep Build-SwiftTesting Windows $Arch
@@ -2445,6 +2479,7 @@ if (-not $SkipBuild) {
24452479if (-not $SkipBuild ) {
24462480 # Build Macros for distribution
24472481 Invoke-BuildStep Build-FoundationMacros Windows $HostArch
2482+ Invoke-BuildStep Build-TestingMacros Windows $HostArch
24482483}
24492484
24502485if (-not $ToBatch ) {
@@ -2466,8 +2501,6 @@ if (-not $ToBatch) {
24662501}
24672502
24682503if (-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
24712504 Invoke-BuildStep Build-SQLite $HostArch
24722505 Invoke-BuildStep Build-System $HostArch
24732506 Invoke-BuildStep Build-ToolsSupportCore $HostArch
0 commit comments