Skip to content

Commit 89eef67

Browse files
committed
utils: precompute binary cache locations
1 parent 3990eaa commit 89eef67

File tree

1 file changed

+52
-16
lines changed

1 file changed

+52
-16
lines changed

utils/build.ps1

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,9 +2450,45 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
24502450
Invoke-IsolatingEnvVars {
24512451
$env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}"
24522452

2453+
$RuntimeBinaryCache = if ($Static) {
2454+
Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime
2455+
} else {
2456+
throw "dynamic Experimental Runtime is not yet implemented"
2457+
}
2458+
2459+
$OverlayBinaryCache = if ($Static) {
2460+
Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay
2461+
} else {
2462+
throw "dynamic Experimental Runtime is not yet implemented"
2463+
}
2464+
2465+
$StringProcessingBinaryCache = if ($Static) {
2466+
Get-ProjectBinarycache $Platform ExperimentalStaticStringProcessing
2467+
} else {
2468+
throw "dynamic Experimental Runtime is not yet implemented"
2469+
}
2470+
2471+
$SynchronizationBinaryCache = if ($Static) {
2472+
Get-ProjectBinarycache $Platform ExperimentalStaticSynchronization
2473+
} else {
2474+
throw "dynamic Experimental Runtime is not yet implemented"
2475+
}
2476+
2477+
$DistributedBinaryCache = if ($Static) {
2478+
Get-ProjectBinarycache $Platform ExperimentalStaticDistributed
2479+
} else {
2480+
throw "dynamic Experimental Runtime is not yet implemented"
2481+
}
2482+
2483+
$ObservationBinaryCache = if ($Static) {
2484+
Get-ProjectBinarycache $Platform ExperimentalStaticObservation
2485+
} else {
2486+
throw "dynamic Experimental Runtime is not yet implemented"
2487+
}
2488+
24532489
Build-CMakeProject `
24542490
-Src $SourceCache\swift\Runtimes\Core `
2455-
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime) `
2491+
-Bin $RuntimeBinaryCache `
24562492
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
24572493
-Platform $Platform `
24582494
-UseBuiltCompilers C,CXX,Swift `
@@ -2481,7 +2517,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
24812517

24822518
Build-CMakeProject `
24832519
-Src $SourceCache\swift\Runtimes\Overlay `
2484-
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay) `
2520+
-Bin $OverlayBinaryCache `
24852521
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
24862522
-Platform $Platform `
24872523
-UseBuiltCompilers C,CXX,Swift `
@@ -2495,12 +2531,12 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
24952531
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
24962532
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
24972533

2498-
SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore";
2534+
SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
24992535
}
25002536

25012537
Build-CMakeProject `
25022538
-Src $SourceCache\swift\Runtimes\Supplemental\StringProcessing `
2503-
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticStringProcessing) `
2539+
-Bin $StringProcessingBinaryCache `
25042540
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
25052541
-Platform $Platform `
25062542
-UseBuiltCompilers C,Swift `
@@ -2514,12 +2550,12 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25142550
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
25152551
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
25162552

2517-
SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore";
2553+
SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
25182554
}
25192555

25202556
Build-CMakeProject `
25212557
-Src $SourceCache\swift\Runtimes\Supplemental\Synchronization `
2522-
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticSynchronization) `
2558+
-Bin $SynchronizationBinaryCache `
25232559
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
25242560
-Platform $Platform `
25252561
-UseBuiltCompilers C,Swift `
@@ -2533,13 +2569,13 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25332569
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
25342570
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
25352571

2536-
SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore";
2537-
SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay";
2572+
SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
2573+
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
25382574
}
25392575

25402576
Build-CMakeProject `
25412577
-Src $SourceCache\swift\Runtimes\Supplemental\Distributed `
2542-
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDistributed) `
2578+
-Bin $DistributedBinaryCache `
25432579
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
25442580
-Platform $Platform `
25452581
-UseBuiltCompilers C,CXX,Swift `
@@ -2548,19 +2584,19 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25482584
-Defines @{
25492585
BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
25502586
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
2551-
CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\include");
2587+
CMAKE_CXX_FLAGS = @("-I${RuntimeBinaryCache}\include");
25522588
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform);
25532589
CMAKE_Swift_COMPILER_WORKS = "YES";
25542590
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
25552591
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
25562592

2557-
SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore";
2558-
SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay";
2593+
SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
2594+
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
25592595
}
25602596

25612597
Build-CMakeProject `
25622598
-Src $SourceCache\swift\Runtimes\Supplemental\Observation `
2563-
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticObservation) `
2599+
-Bin $ObservationBinaryCache `
25642600
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
25652601
-Platform $Platform `
25662602
-UseBuiltCompilers CXX,Swift `
@@ -2569,14 +2605,14 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25692605
-Defines @{
25702606
BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
25712607
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
2572-
CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\include");
2608+
CMAKE_CXX_FLAGS = @("-I${RuntimeBinaryCache}\include");
25732609
CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform);
25742610
CMAKE_Swift_COMPILER_WORKS = "YES";
25752611
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
25762612
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
25772613

2578-
SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore";
2579-
SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay";
2614+
SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
2615+
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
25802616
}
25812617
}
25822618
}

0 commit comments

Comments
 (0)