From cc6b74342a3ea863030b67e082ba1f957e376685 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Wed, 21 Aug 2024 09:38:08 -0700 Subject: [PATCH] Fix another cross-compile build failure. This fix is similar to https://github.com/swiftlang/swift/pull/75970 but for `Build-TestingMacros`. --- utils/build.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 2286e33d1d72d..b83bab6533d13 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -2288,7 +2288,7 @@ function Build-TestingMacros() { $SwiftSDK = $null if ($Build) { - $SwiftSDK = $HostArch.SDKInstallRoot + $SwiftSDK = $BuildArch.SDKInstallRoot } $Targets = if ($Build) { @@ -2302,6 +2302,12 @@ function Build-TestingMacros() { $InstallDir = "$($Arch.ToolchainInstallRoot)\usr" } + $SwiftSyntaxCMakeModules = if ($Build -and $HostArch -ne $BuildArch) { + Get-BuildProjectCMakeModules Compilers + } else { + Get-HostProjectCMakeModules Compilers + } + Build-CMakeProject ` -Src $SourceCache\swift-testing\Sources\TestingMacros ` -Bin $TestingMacrosBinaryCache ` @@ -2312,7 +2318,7 @@ function Build-TestingMacros() { -SwiftSDK:$SwiftSDK ` -BuildTargets $Targets ` -Defines @{ - SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers); + SwiftSyntax_DIR = $SwiftSyntaxCMakeModules; } }