Skip to content

Commit fe331e1

Browse files
committed
build.ps1: repair XCTest 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 8f7af45 commit fe331e1

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
@@ -3108,6 +3108,12 @@ function Build-FoundationMacros([Hashtable] $Platform) {
31083108
}
31093109

31103110
function Build-XCTest([Hashtable] $Platform) {
3111+
$SwiftFlags = if ($Platform.OS -eq [OS]::Windows) {
3112+
@();
3113+
} else {
3114+
@("-I$(Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK)\usr\lib\swift");
3115+
}
3116+
31113117
Build-CMakeProject `
31123118
-Src $SourceCache\swift-corelibs-xctest `
31133119
-Bin (Get-ProjectBinaryCache $Platform XCTest) `
@@ -3118,6 +3124,7 @@ function Build-XCTest([Hashtable] $Platform) {
31183124
-Defines @{
31193125
BUILD_SHARED_LIBS = "YES";
31203126
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
3127+
CMAKE_Swift_FLAGS = $SwiftFlags;
31213128
ENABLE_TESTING = "NO";
31223129
XCTest_INSTALL_NESTED_SUBDIR = "YES";
31233130
}

0 commit comments

Comments
 (0)