Skip to content

Commit 95227f9

Browse files
committed
build.ps1: compute SDKROOT once in the experimental runtimes build
This value is re-used. Compute it once and re-use the value to ease the future transition.
1 parent 8335d82 commit 95227f9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

utils/build.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,8 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
24682468
Invoke-IsolatingEnvVars {
24692469
$env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}"
24702470

2471+
$SDKRoot = Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental"
2472+
24712473
$RuntimeBinaryCache = if ($Static) {
24722474
Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime
24732475
} else {
@@ -2513,7 +2515,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25132515
Build-CMakeProject `
25142516
-Src $SourceCache\swift\Runtimes\Core `
25152517
-Bin $RuntimeBinaryCache `
2516-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2518+
-InstallTo "${SDKROOT}\usr" `
25172519
-Platform $Platform `
25182520
-UseBuiltCompilers C,CXX,Swift `
25192521
-UseGNUDriver `
@@ -2541,7 +2543,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25412543
Build-CMakeProject `
25422544
-Src $SourceCache\swift\Runtimes\Overlay `
25432545
-Bin $OverlayBinaryCache `
2544-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2546+
-InstallTo "${SDKROOT}\usr" `
25452547
-Platform $Platform `
25462548
-UseBuiltCompilers C,CXX,Swift `
25472549
-UseGNUDriver `
@@ -2559,7 +2561,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25592561
Build-CMakeProject `
25602562
-Src $SourceCache\swift\Runtimes\Supplemental\StringProcessing `
25612563
-Bin $StringProcessingBinaryCache `
2562-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2564+
-InstallTo "${SDKROOT}\usr" `
25632565
-Platform $Platform `
25642566
-UseBuiltCompilers C,Swift `
25652567
-UseGNUDriver `
@@ -2577,7 +2579,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25772579
Build-CMakeProject `
25782580
-Src $SourceCache\swift\Runtimes\Supplemental\Synchronization `
25792581
-Bin $SynchronizationBinaryCache `
2580-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2582+
-InstallTo "${SDKROOT}\usr" `
25812583
-Platform $Platform `
25822584
-UseBuiltCompilers C,Swift `
25832585
-UseGNUDriver `
@@ -2596,7 +2598,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
25962598
Build-CMakeProject `
25972599
-Src $SourceCache\swift\Runtimes\Supplemental\Distributed `
25982600
-Bin $DistributedBinaryCache `
2599-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2601+
-InstallTo "${SDKROOT}\usr" `
26002602
-Platform $Platform `
26012603
-UseBuiltCompilers C,CXX,Swift `
26022604
-UseGNUDriver `
@@ -2616,7 +2618,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
26162618
Build-CMakeProject `
26172619
-Src $SourceCache\swift\Runtimes\Supplemental\Observation `
26182620
-Bin $ObservationBinaryCache `
2619-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2621+
-InstallTo "${SDKROOT}\usr" `
26202622
-Platform $Platform `
26212623
-UseBuiltCompilers CXX,Swift `
26222624
-UseGNUDriver `
@@ -2636,7 +2638,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
26362638
Build-CMakeProject `
26372639
-Src $SourceCache\swift\Runtimes\Supplemental\Differentiation `
26382640
-Bin $DifferentiationBinaryCache `
2639-
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
2641+
-InstallTo "${SDKROOT}\usr" `
26402642
-Platform $Platform `
26412643
-UseBuiltCompilers C,CXX,Swift `
26422644
-UseGNUDriver `

0 commit comments

Comments
 (0)