Skip to content

Commit 682b38d

Browse files
authored
Merge pull request #83411 from compnerd/build-root
build.ps1: compute the proper SDK for building the runtime
2 parents 7542f2f + b1d1db7 commit 682b38d

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

utils/build.ps1

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,7 @@ function Test-Dispatch {
27172717
-Src $SourceCache\swift-corelibs-libdispatch `
27182718
-Bin (Get-ProjectBinaryCache $BuildPlatform Dispatch) `
27192719
-Platform $BuildPlatform `
2720-
-SwiftSDK (Get-SwiftSDK Windows) `
2720+
-SwiftSDK (Get-SwiftSDK $BuildPlatform.OS) `
27212721
-BuildTargets default,ExperimentalTest `
27222722
-UseBuiltCompilers C,CXX,Swift `
27232723
-Defines @{
@@ -2806,7 +2806,7 @@ function Test-Foundation {
28062806
-Platform $BuildPlatform
28072807

28082808
Invoke-IsolatingEnvVars {
2809-
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK Windows)/usr/include"
2809+
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK $BuildPlatform.OS)/usr/include"
28102810
$env:LIBXML_LIBRARY_PATH="$BinaryCache/$($Platform.Triple)/usr/lib"
28112811
$env:LIBXML_INCLUDE_PATH="$BinaryCache/$($Platform.Triple)/usr/include/libxml2"
28122812
$env:ZLIB_LIBRARY_PATH="$BinaryCache/$($Platform.Triple)/usr/lib"
@@ -3020,7 +3020,7 @@ function Build-System([Hashtable] $Platform) {
30203020
-Bin (Get-ProjectBinaryCache $Platform System) `
30213021
-Platform $Platform `
30223022
-UseBuiltCompilers C,Swift `
3023-
-SwiftSDK (Get-SwiftSDK Windows) `
3023+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
30243024
-BuildTargets default `
30253025
-Defines @{
30263026
BUILD_SHARED_LIBS = "NO";
@@ -3039,7 +3039,7 @@ function Build-Build([Hashtable] $Platform) {
30393039
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
30403040
-Platform $Platform `
30413041
-UseBuiltCompilers C,CXX,Swift `
3042-
-SwiftSDK (Get-SwiftSDK Windows) `
3042+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
30433043
-Defines (@{
30443044
BUILD_SHARED_LIBS = "YES";
30453045
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
@@ -3060,7 +3060,7 @@ function Build-ToolsSupportCore([Hashtable] $Platform) {
30603060
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
30613061
-Platform $Platform `
30623062
-UseBuiltCompilers C,Swift `
3063-
-SwiftSDK (Get-SwiftSDK Windows) `
3063+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
30643064
-Defines @{
30653065
BUILD_SHARED_LIBS = "YES";
30663066
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
@@ -3079,7 +3079,7 @@ function Build-LLBuild([Hashtable] $Platform) {
30793079
-Platform $Platform `
30803080
-UseMSVCCompilers CXX `
30813081
-UseBuiltCompilers Swift `
3082-
-SwiftSDK (Get-SwiftSDK Windows) `
3082+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
30833083
-Defines @{
30843084
BUILD_SHARED_LIBS = "YES";
30853085
LLBUILD_SUPPORT_BINDINGS = "Swift";
@@ -3106,7 +3106,7 @@ function Test-LLBuild {
31063106
-Platform $Platform `
31073107
-UseMSVCCompilers CXX `
31083108
-UseBuiltCompilers Swift `
3109-
-SwiftSDK (Get-SwiftSDK Windows) `
3109+
-SwiftSDK (Get-SwiftSDK $BuildPlatform.OS) `
31103110
-BuildTargets default,test-llbuild `
31113111
-Defines = @{
31123112
BUILD_SHARED_LIBS = "YES";
@@ -3126,7 +3126,7 @@ function Build-ArgumentParser([Hashtable] $Platform) {
31263126
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
31273127
-Platform $Platform `
31283128
-UseBuiltCompilers Swift `
3129-
-SwiftSDK (Get-SwiftSDK Windows) `
3129+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
31303130
-Defines @{
31313131
BUILD_SHARED_LIBS = "YES";
31323132
BUILD_TESTING = "NO";
@@ -3141,7 +3141,7 @@ function Build-Driver([Hashtable] $Platform) {
31413141
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
31423142
-Platform $Platform `
31433143
-UseBuiltCompilers C,CXX,Swift `
3144-
-SwiftSDK (Get-SwiftSDK Windows) `
3144+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
31453145
-Defines @{
31463146
BUILD_SHARED_LIBS = "YES";
31473147
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
@@ -3163,7 +3163,7 @@ function Build-Crypto([Hashtable] $Platform) {
31633163
-Bin (Get-ProjectBinaryCache $Platform Crypto) `
31643164
-Platform $Platform `
31653165
-UseBuiltCompilers ASM, C, CXX, Swift `
3166-
-SwiftSDK (Get-SwiftSDK Windows) `
3166+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
31673167
-BuildTargets default `
31683168
-Defines @{
31693169
BUILD_SHARED_LIBS = "NO";
@@ -3179,7 +3179,7 @@ function Build-Collections([Hashtable] $Platform) {
31793179
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
31803180
-Platform $Platform `
31813181
-UseBuiltCompilers C,Swift `
3182-
-SwiftSDK (Get-SwiftSDK Windows) `
3182+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
31833183
-Defines @{
31843184
BUILD_SHARED_LIBS = "YES";
31853185
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
@@ -3192,7 +3192,7 @@ function Build-ASN1([Hashtable] $Platform) {
31923192
-Bin (Get-ProjectBinaryCache $Platform ASN1) `
31933193
-Platform $Platform `
31943194
-UseBuiltCompilers Swift `
3195-
-SwiftSDK (Get-SwiftSDK Windows) `
3195+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
31963196
-BuildTargets default `
31973197
-Defines @{
31983198
BUILD_SHARED_LIBS = "NO";
@@ -3206,7 +3206,7 @@ function Build-Certificates([Hashtable] $Platform) {
32063206
-Bin (Get-ProjectBinaryCache $Platform Certificates) `
32073207
-Platform $Platform `
32083208
-UseBuiltCompilers Swift `
3209-
-SwiftSDK (Get-SwiftSDK Windows) `
3209+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
32103210
-BuildTargets default `
32113211
-Defines @{
32123212
BUILD_SHARED_LIBS = "NO";
@@ -3229,7 +3229,7 @@ function Build-PackageManager([Hashtable] $Platform) {
32293229
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
32303230
-Platform $Platform `
32313231
-UseBuiltCompilers C,Swift `
3232-
-SwiftSDK (Get-SwiftSDK Windows) `
3232+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
32333233
-Defines @{
32343234
BUILD_SHARED_LIBS = "YES";
32353235
CMAKE_Swift_FLAGS = @("-DCRYPTO_v2");
@@ -3257,7 +3257,7 @@ function Build-Markdown([Hashtable] $Platform) {
32573257
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
32583258
-Platform $Platform `
32593259
-UseBuiltCompilers C,Swift `
3260-
-SwiftSDK (Get-SwiftSDK Windows) `
3260+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
32613261
-Defines @{
32623262
BUILD_SHARED_LIBS = "NO";
32633263
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
@@ -3274,7 +3274,7 @@ function Build-Format([Hashtable] $Platform) {
32743274
-Platform $Platform `
32753275
-UseMSVCCompilers C `
32763276
-UseBuiltCompilers Swift `
3277-
-SwiftSDK (Get-SwiftSDK Windows) `
3277+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
32783278
-Defines @{
32793279
BUILD_SHARED_LIBS = "YES";
32803280
ArgumentParser_DIR = (Get-ProjectCMakeModules $Platform ArgumentParser);
@@ -3337,13 +3337,13 @@ function Build-IndexStoreDB([Hashtable] $Platform) {
33373337
-Bin (Get-ProjectBinaryCache $Platform IndexStoreDB) `
33383338
-Platform $Platform `
33393339
-UseBuiltCompilers C,CXX,Swift `
3340-
-SwiftSDK (Get-SwiftSDK Windows) `
3340+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
33413341
-BuildTargets default `
33423342
-Defines @{
33433343
BUILD_SHARED_LIBS = "NO";
33443344
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
3345-
CMAKE_C_FLAGS = @("-I$(Get-SwiftSDK Windows)\usr\include", "-I$(Get-SwiftSDK Windows)\usr\include\Block");
3346-
CMAKE_CXX_FLAGS = @("-I$(Get-SwiftSDK Windows)\usr\include", "-I$(Get-SwiftSDK Windows)\usr\include\Block");
3345+
CMAKE_C_FLAGS = @("-I$(Get-SwiftSDK $Platform.OS)\usr\include", "-I$(Get-SwiftSDK $Platform.OS)\usr\include\Block");
3346+
CMAKE_CXX_FLAGS = @("-I$(Get-SwiftSDK $Platform.OS)\usr\include", "-I$(Get-SwiftSDK $Platform.OS)\usr\include\Block");
33473347
LMDB_DIR = (Get-ProjectCMakeModules $Platform LMDB);
33483348
}
33493349
}
@@ -3355,7 +3355,7 @@ function Build-SourceKitLSP([Hashtable] $Platform) {
33553355
-InstallTo "$($Platform.ToolchainInstallRoot)\usr" `
33563356
-Platform $Platform `
33573357
-UseBuiltCompilers C,Swift `
3358-
-SwiftSDK (Get-SwiftSDK Windows) `
3358+
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
33593359
-Defines @{
33603360
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
33613361
SwiftSyntax_DIR = (Get-ProjectCMakeModules $Platform Compilers);

0 commit comments

Comments
 (0)