Skip to content

Commit c950a94

Browse files
authored
Merge pull request #75988 from hjyamauchi/buildps1
Fix cross-compile build failure.
2 parents 5a39ece + 909b4d9 commit c950a94

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

utils/build.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ function Build-FoundationMacros() {
14811481

14821482
$SwiftSDK = $null
14831483
if ($Build) {
1484-
$SwiftSDK = $HostArch.SDKInstallRoot
1484+
$SwiftSDK = $BuildArch.SDKInstallRoot
14851485
}
14861486

14871487
$Targets = if ($Build) {
@@ -1495,6 +1495,12 @@ function Build-FoundationMacros() {
14951495
$InstallDir = "$($Arch.ToolchainInstallRoot)\usr"
14961496
}
14971497

1498+
$SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch) {
1499+
Get-BuildProjectCMakeModules Compilers
1500+
} else {
1501+
Get-HostProjectCMakeModules Compilers
1502+
}
1503+
14981504
Build-CMakeProject `
14991505
-Src $SourceCache\swift-foundation\Sources\FoundationMacros `
15001506
-Bin $FoundationMacrosBinaryCache `
@@ -1505,7 +1511,7 @@ function Build-FoundationMacros() {
15051511
-SwiftSDK:$SwiftSDK `
15061512
-BuildTargets $Targets `
15071513
-Defines @{
1508-
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
1514+
SwiftSyntax_DIR = $SwiftSyntaxCMakeModules;
15091515
}
15101516
}
15111517

0 commit comments

Comments
 (0)