Skip to content

Commit aa1f000

Browse files
authored
Merge pull request #84505 from compnerd/android
build.ps1: repair Android cross-compilation
2 parents 887bfb7 + e7843bf commit aa1f000

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

utils/build.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3056,6 +3056,12 @@ function Build-FoundationMacros([Hashtable] $Platform) {
30563056
}
30573057

30583058
function Build-XCTest([Hashtable] $Platform) {
3059+
$SwiftFlags = if ($Platform.OS -eq [OS]::Windows) {
3060+
@();
3061+
} else {
3062+
@("-I$(Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK)\usr\lib\swift");
3063+
}
3064+
30593065
Build-CMakeProject `
30603066
-Src $SourceCache\swift-corelibs-xctest `
30613067
-Bin (Get-ProjectBinaryCache $Platform XCTest) `
@@ -3066,6 +3072,7 @@ function Build-XCTest([Hashtable] $Platform) {
30663072
-Defines @{
30673073
BUILD_SHARED_LIBS = "YES";
30683074
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
3075+
CMAKE_Swift_FLAGS = $SwiftFlags;
30693076
ENABLE_TESTING = "NO";
30703077
XCTest_INSTALL_NESTED_SUBDIR = "YES";
30713078
}
@@ -3112,6 +3119,12 @@ function Test-XCTest {
31123119
}
31133120

31143121
function Build-Testing([Hashtable] $Platform) {
3122+
$SwiftFlags = if ($Platform.OS -eq [OS]::Windows) {
3123+
@();
3124+
} else {
3125+
@("-I$(Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK)\usr\lib\swift");
3126+
}
3127+
31153128
Build-CMakeProject `
31163129
-Src $SourceCache\swift-testing `
31173130
-Bin (Get-ProjectBinaryCache $Platform Testing) `
@@ -3122,6 +3135,7 @@ function Build-Testing([Hashtable] $Platform) {
31223135
-Defines @{
31233136
BUILD_SHARED_LIBS = "YES";
31243137
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
3138+
CMAKE_Swift_FLAGS = $SwiftFlags;
31253139
SwiftTesting_MACRO = "$(Get-ProjectBinaryCache $BuildPlatform BootstrapTestingMacros)\TestingMacros.dll";
31263140
SwiftTesting_INSTALL_NESTED_SUBDIR = "YES";
31273141
}
@@ -3856,7 +3870,7 @@ function Build-Inspect([Hashtable] $Platform) {
38563870
$InstallPath = "$(Get-PlatformRoot $Platform.OS)\Developer\Library\$(Get-ModuleTriple $Platform)"
38573871
}
38583872

3859-
$SDKROOT = Get-SwiftSDK $Platform.OS
3873+
$SDKROOT = Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK
38603874

38613875
Build-CMakeProject `
38623876
-Src $SourceCache\swift\tools\swift-inspect `

0 commit comments

Comments
 (0)