Skip to content

Commit ebf3ec7

Browse files
authored
Merge pull request #75970 from hjyamauchi/crosscompilefix
Fix cross-compile build failure.
2 parents f47b292 + 3054eab commit ebf3ec7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: utils/build.ps1

+8-2
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ function Build-FoundationMacros() {
17571757

17581758
$SwiftSDK = $null
17591759
if ($Build) {
1760-
$SwiftSDK = $HostArch.SDKInstallRoot
1760+
$SwiftSDK = $BuildArch.SDKInstallRoot
17611761
}
17621762

17631763
$Targets = if ($Build) {
@@ -1771,6 +1771,12 @@ function Build-FoundationMacros() {
17711771
$InstallDir = "$($Arch.ToolchainInstallRoot)\usr"
17721772
}
17731773

1774+
$SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch) {
1775+
Get-BuildProjectCMakeModules Compilers
1776+
} else {
1777+
Get-HostProjectCMakeModules Compilers
1778+
}
1779+
17741780
Build-CMakeProject `
17751781
-Src $SourceCache\swift-foundation\Sources\FoundationMacros `
17761782
-Bin $FoundationMacrosBinaryCache `
@@ -1781,7 +1787,7 @@ function Build-FoundationMacros() {
17811787
-SwiftSDK:$SwiftSDK `
17821788
-BuildTargets $Targets `
17831789
-Defines @{
1784-
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
1790+
SwiftSyntax_DIR = $SwiftSyntaxCMakeModules;
17851791
}
17861792
}
17871793

0 commit comments

Comments
 (0)