@@ -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
@@ -2316,42 +2320,43 @@ function Build-FoundationMacros() {
2316
2320
}
2317
2321
}
2318
2322
2319
- function Build-XCTest ([Platform ]$Platform , $Arch , [switch ]$Test = $false ) {
2320
- $DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
2321
- $FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch DynamicFoundation
2322
- $XCTestBinaryCache = Get-TargetProjectBinaryCache $Arch XCTest
2323
+ function Build-XCTest ([Platform ]$Platform , $Arch ) {
2324
+ Build-CMakeProject `
2325
+ - Src $SourceCache \swift- corelibs- xctest `
2326
+ - Bin $ (Get-TargetProjectBinaryCache $Arch XCTest) `
2327
+ - InstallTo " $ ( $Arch.XCTestInstallRoot ) \usr" `
2328
+ - Arch $Arch `
2329
+ - Platform $Platform `
2330
+ - UseBuiltCompilers Swift `
2331
+ - Defines @ {
2332
+ CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
2333
+ ENABLE_TESTING = " NO" ;
2334
+ dispatch_DIR = $ (Get-TargetProjectCMakeModules $Arch Dispatch);
2335
+ Foundation_DIR = $ (Get-TargetProjectCMakeModules $Arch DynamicFoundation);
2336
+ }
2337
+ }
2323
2338
2339
+ function Test-XCTest {
2324
2340
Isolate- EnvVars {
2325
- if ($Test ) {
2326
- $TestingDefines = @ {
2327
- ENABLE_TESTING = " YES" ;
2328
- LLVM_DIR = " $ ( Get-TargetProjectBinaryCache $Arch LLVM) /lib/cmake/llvm" ;
2329
- XCTEST_PATH_TO_LIBDISPATCH_BUILD = $DispatchBinaryCache ;
2330
- XCTEST_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
2331
- XCTEST_PATH_TO_FOUNDATION_BUILD = $FoundationBinaryCache ;
2332
- }
2333
- $Targets = @ (" default" , " check-xctest" )
2334
- $InstallPath = " "
2335
- $env: Path = " $XCTestBinaryCache ;$FoundationBinaryCache \bin;$DispatchBinaryCache ;$ ( Get-TargetProjectBinaryCache $Arch Runtime) \bin;$env: Path ;$UnixToolsBinDir "
2336
- } else {
2337
- $TestingDefines = @ { ENABLE_TESTING = " NO" }
2338
- $Targets = @ (" install" )
2339
- $InstallPath = " $ ( $Arch.XCTestInstallRoot ) \usr"
2340
- }
2341
+ $env: Path = " $ ( Get-TargetProjectBinaryCache $BuildArch XCTest) \bin;$ ( Get-TargetProjectBinaryCache $BuildArch Dispatch) ;$ ( Get-TargetProjectBinaryCache $BuildArch Runtime) \bin;${env: Path} ;$UnixToolsBinDir "
2341
2342
2342
2343
Build-CMakeProject `
2343
2344
- Src $SourceCache \swift- corelibs- xctest `
2344
- - Bin $XCTestBinaryCache `
2345
- - InstallTo $InstallPath `
2346
- - Arch $Arch `
2347
- - Platform $Platform `
2345
+ - Bin (Get-TargetProjectBinaryCache $BuildArch XCTest) `
2346
+ - Arch $BuildArch `
2347
+ - Platform Windows `
2348
2348
- UseBuiltCompilers Swift `
2349
- - BuildTargets $Targets `
2350
- - Defines ( @ {
2349
+ - BuildTargets default , check - xctest `
2350
+ - Defines @ {
2351
2351
CMAKE_BUILD_WITH_INSTALL_RPATH = " YES" ;
2352
- dispatch_DIR = " $DispatchBinaryCache \cmake\modules" ;
2353
- Foundation_DIR = " $FoundationBinaryCache \cmake\modules" ;
2354
- } + $TestingDefines )
2352
+ ENABLE_TESTING = " YES" ;
2353
+ dispatch_DIR = $ (Get-TargetProjectBinaryCache $BuildArch Dispatch);
2354
+ Foundation_DIR = $ (Get-TargetProjectBinaryCache $BuildArch DynamicFoundation);
2355
+ LLVM_DIR = " $ ( Get-TargetProjectBinaryCache $BuildArch LLVM) \lib\cmake\llvm" ;
2356
+ XCTEST_PATH_TO_FOUNDATION_BUILD = $ (Get-TargetProjectBinaryCache $BuildArch DynamicFoundation);
2357
+ XCTEST_PATH_TO_LIBDISPATCH_BUILD = $ (Get-TargetProjectBinaryCache $BuildArch Dispatch);
2358
+ XCTEST_PATH_TO_LIBDISPATCH_SOURCE = " $SourceCache \swift-corelibs-libdispatch" ;
2359
+ }
2355
2360
}
2356
2361
}
2357
2362
@@ -3280,7 +3285,7 @@ if (-not $IsCrossCompiling) {
3280
3285
Build-Foundation Windows $HostArch - Test
3281
3286
}
3282
3287
if ($Test -contains " xctest" ) {
3283
- Build -XCTest Windows $HostArch - Test
3288
+ Test -XCTest
3284
3289
}
3285
3290
if ($Test -contains " testing" ) {
3286
3291
Build-Testing Windows $HostArch - Test
0 commit comments