@@ -442,6 +442,10 @@ function Get-TargetProjectBinaryCache($Arch, [TargetComponent]$Project) {
442
442
return " $BinaryCache \$ ( $Arch.LLVMTarget ) \$Project "
443
443
}
444
444
445
+ function Get-TargetProjectCMakeModules ($Arch , [TargetComponent ]$Project ) {
446
+ return " $Binarycache \$ ( $Arch.LLVMTarget ) \$Project \cmake\modules"
447
+ }
448
+
445
449
enum HostComponent {
446
450
Compilers
447
451
FoundationMacros
@@ -2336,42 +2340,43 @@ function Build-FoundationMacros() {
2336
2340
}
2337
2341
}
2338
2342
2339
- function Build-XCTest ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
2340
- $DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
2341
- $FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch DynamicFoundation
2342
- $XCTestBinaryCache = Get-TargetProjectBinaryCache $Arch XCTest
2343
+ function Build-XCTest ([Platform ]$Platform , $Arch ) {
2344
+ Build-CMakeProject `
2345
+ - Src $SourceCache \swift- corelibs- xctest `
2346
+ - Bin $ (Get-TargetProjectBinaryCache $Arch XCTest) `
2347
+ - InstallTo " $ ( $Arch.XCTestInstallRoot ) \usr" `
2348
+ - Arch $Arch `
2349
+ - Platform $Platform `
2350
+ - UseBuiltCompilers Swift `
2351
+ - Defines @ {
2352
+ CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
2353
+ ENABLE_TESTING = " NO" ;
2354
+ dispatch_DIR = $ (Get-TargetProjectCMakeModules $Arch Dispatch);
2355
+ Foundation_DIR = $ (Get-TargetProjectCMakeModules $Arch DynamicFoundation);
2356
+ }
2357
+ }
2343
2358
2359
+ function Test-XCTest {
2344
2360
Isolate- EnvVars {
2345
- if ($Test ) {
2346
- $TestingDefines = @ {
2347
- ENABLE_TESTING = " YES" ;
2348
- LLVM_DIR = " $ ( Get-TargetProjectBinaryCache $Arch LLVM) /lib/cmake/llvm" ;
2349
- XCTEST_PATH_TO_LIBDISPATCH_BUILD = $DispatchBinaryCache ;
2350
- XCTEST_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
2351
- XCTEST_PATH_TO_FOUNDATION_BUILD = $FoundationBinaryCache ;
2352
- }
2353
- $Targets = @ (" default" , " check-xctest" )
2354
- $InstallPath = " "
2355
- $env: Path = " $XCTestBinaryCache ;$FoundationBinaryCache \bin;$DispatchBinaryCache ;$ ( Get-TargetProjectBinaryCache $Arch Runtime) \bin;$env: Path ;$UnixToolsBinDir "
2356
- } else {
2357
- $TestingDefines = @ { ENABLE_TESTING = " NO" }
2358
- $Targets = @ (" install" )
2359
- $InstallPath = " $ ( $Arch.XCTestInstallRoot ) \usr"
2360
- }
2361
+ $env: Path = " $ ( Get-TargetProjectBinaryCache $BuildArch XCTest) \bin;$ ( Get-TargetProjectBinaryCache $BuildArch Dispatch) ;$ ( Get-TargetProjectBinaryCache $BuildArch Runtime) \bin;${env: Path} ;$UnixToolsBinDir "
2361
2362
2362
2363
Build-CMakeProject `
2363
2364
- Src $SourceCache \swift- corelibs- xctest `
2364
- - Bin $XCTestBinaryCache `
2365
- - InstallTo $InstallPath `
2366
- - Arch $Arch `
2367
- - Platform $Platform `
2365
+ - Bin (Get-TargetProjectBinaryCache $BuildArch XCTest) `
2366
+ - Arch $BuildArch `
2367
+ - Platform Windows `
2368
2368
- UseBuiltCompilers Swift `
2369
- - BuildTargets $Targets `
2370
- - Defines ( @ {
2369
+ - BuildTargets default , check - xctest `
2370
+ - Defines @ {
2371
2371
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
2372
- dispatch_DIR = " $DispatchBinaryCache \cmake\modules" ;
2373
- Foundation_DIR = " $FoundationBinaryCache \cmake\modules" ;
2374
- } + $TestingDefines )
2372
+ ENABLE_TESTING = " YES" ;
2373
+ dispatch_DIR = $ (Get-TargetProjectCMakeModules $BuildArch Dispatch);
2374
+ Foundation_DIR = $ (Get-TargetProjectCMakeModules $BuildArch DynamicFoundation);
2375
+ LLVM_DIR = " $ ( Get-TargetProjectBinaryCache $BuildArch LLVM) \lib\cmake\llvm" ;
2376
+ XCTEST_PATH_TO_FOUNDATION_BUILD = $ (Get-TargetProjectBinaryCache $BuildArch DynamicFoundation);
2377
+ XCTEST_PATH_TO_LIBDISPATCH_BUILD = $ (Get-TargetProjectBinaryCache $BuildArch Dispatch);
2378
+ XCTEST_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
2379
+ }
2375
2380
}
2376
2381
}
2377
2382
@@ -3309,7 +3314,7 @@ if (-not $IsCrossCompiling) {
3309
3314
Build-Foundation Windows $HostArch - Test
3310
3315
}
3311
3316
if ($Test -contains " xctest" ) {
3312
- Build -XCTest Windows $HostArch - Test
3317
+ Test -XCTest
3313
3318
}
3314
3319
if ($Test -contains " testing" ) {
3315
3320
Build-Testing Windows $HostArch - Test
0 commit comments