Skip to content

Commit cc6b743

Browse files
committed
Fix another cross-compile build failure.
This fix is similar to #75970 but for `Build-TestingMacros`.
1 parent 3df5e9c commit cc6b743

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
@@ -2288,7 +2288,7 @@ function Build-TestingMacros() {
22882288

22892289
$SwiftSDK = $null
22902290
if ($Build) {
2291-
$SwiftSDK = $HostArch.SDKInstallRoot
2291+
$SwiftSDK = $BuildArch.SDKInstallRoot
22922292
}
22932293

22942294
$Targets = if ($Build) {
@@ -2302,6 +2302,12 @@ function Build-TestingMacros() {
23022302
$InstallDir = "$($Arch.ToolchainInstallRoot)\usr"
23032303
}
23042304

2305+
$SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch) {
2306+
Get-BuildProjectCMakeModules Compilers
2307+
} else {
2308+
Get-HostProjectCMakeModules Compilers
2309+
}
2310+
23052311
Build-CMakeProject `
23062312
-Src $SourceCache\swift-testing\Sources\TestingMacros `
23072313
-Bin $TestingMacrosBinaryCache `
@@ -2312,7 +2318,7 @@ function Build-TestingMacros() {
23122318
-SwiftSDK:$SwiftSDK `
23132319
-BuildTargets $Targets `
23142320
-Defines @{
2315-
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2321+
SwiftSyntax_DIR = $SwiftSyntaxCMakeModules;
23162322
}
23172323
}
23182324

0 commit comments

Comments
 (0)