Skip to content

Commit f9e5a2c

Browse files
committed
build.ps1: repair Testing cross-compilation for Android
Android cross-compilation does not properly add the library search path for `-sdk` which requires we manually inject the additional library search path.
1 parent fe331e1 commit f9e5a2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

utils/build.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,6 +3171,12 @@ function Test-XCTest {
31713171
}
31723172

31733173
function Build-Testing([Hashtable] $Platform) {
3174+
$SwiftFlags = if ($Platform.OS -eq [OS]::Windows) {
3175+
@();
3176+
} else {
3177+
@("-I$(Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK)\usr\lib\swift");
3178+
}
3179+
31743180
Build-CMakeProject `
31753181
-Src $SourceCache\swift-testing `
31763182
-Bin (Get-ProjectBinaryCache $Platform Testing) `
@@ -3181,6 +3187,7 @@ function Build-Testing([Hashtable] $Platform) {
31813187
-Defines @{
31823188
BUILD_SHARED_LIBS = "YES";
31833189
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
3190+
CMAKE_Swift_FLAGS = $SwiftFlags;
31843191
SwiftTesting_MACRO = "$(Get-ProjectBinaryCache $BuildPlatform BootstrapTestingMacros)\TestingMacros.dll";
31853192
SwiftTesting_INSTALL_NESTED_SUBDIR = "YES";
31863193
}

0 commit comments

Comments
 (0)