Skip to content

Commit d3cfaa3

Browse files
authored
Merge pull request #75549 from hyp/eng/buildps1-host-android-sdk-windows-foundation-macros
[build.ps1] add host SDK path when building foundation for Android on…
2 parents 5c31c10 + 386b945 commit d3cfaa3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils/build.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,12 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
16551655
$Targets = @("default", "install")
16561656
$InstallPath = "$($Arch.SDKInstallRoot)\usr"
16571657

1658+
if ($Platform -eq "Android") {
1659+
$HostDefines = @{ CMAKE_HOST_Swift_FLAGS = "-sdk `"$($HostArch.SDKInstallRoot)`"" }
1660+
} else {
1661+
$HostDefines = @{}
1662+
}
1663+
16581664
Build-CMakeProject `
16591665
-Src $SourceCache\swift-corelibs-foundation `
16601666
-Bin $FoundationBinaryCache `
@@ -1684,7 +1690,7 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
16841690
_SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation";
16851691
_SwiftFoundationICU_SourceDIR = "$SourceCache\swift-foundation-icu";
16861692
_SwiftCollections_SourceDIR = "$SourceCache\swift-collections"
1687-
} + $TestingDefines)
1693+
} + $HostDefines + $TestingDefines)
16881694
}
16891695
}
16901696
}

0 commit comments

Comments
 (0)