@@ -521,30 +521,21 @@ function Get-TargetInfo($Arch) {
521
521
# Cache the result of "swift -print-target-info" as $Arch.Cache.TargetInfo
522
522
$CacheKey = " TargetInfo"
523
523
if (-not $Arch.Cache.ContainsKey ($CacheKey )) {
524
- $CompilersBinaryCache = if ($IsCrossCompiling ) {
525
- Get-BuildProjectBinaryCache Compilers
526
- } else {
527
- Get-HostProjectBinaryCache Compilers
528
- }
529
- $ToolchainBinDir = Join-Path - Path $CompilersBinaryCache - ChildPath " bin"
530
- $CMarkDir = Join-Path - Path (Get-CMarkBinaryCache $BuildArch ) - ChildPath " src"
531
- $SwiftExe = Join-Path - Path $ToolchainBinDir - ChildPath " swift.exe"
532
524
Isolate- EnvVars {
533
- $env: Path = " $ToolchainBinDir ; $CMarkDir ; $ ( Get-PinnedToolchainRuntime ) ;${env: Path} "
534
- $TargetInfoJson = & $SwiftExe - target $Arch.LLVMTarget - print- target- info
525
+ $env: Path = " $ ( Get-PinnedToolchainRuntime ) ; $ ( Get-PinnedToolchainToolsDir ) ;${env: Path} "
526
+ $TargetInfo = & swiftc - target $Arch.LLVMTarget - print- target- info
535
527
if ($LastExitCode -ne 0 ) {
536
- throw " Unable to print target info for $ ( $Arch.LLVMTarget ) $TargetInfoJson "
528
+ throw " Unable to print target info for ' $ ( $Arch.LLVMTarget ) ' "
537
529
}
538
- $TargetInfo = $TargetInfoJson | ConvertFrom-Json
530
+ $TargetInfo = $TargetInfo | ConvertFrom-JSON
539
531
$Arch.Cache [$CacheKey ] = $TargetInfo.target
540
532
}
541
533
}
542
534
return $Arch.Cache [$CacheKey ]
543
535
}
544
536
545
537
function Get-ModuleTriple ($Arch ) {
546
- $targetInfo = Get-TargetInfo - Arch $Arch
547
- return $targetInfo.moduleTriple
538
+ return (Get-TargetInfo - Arch $Arch ).moduleTriple
548
539
}
549
540
550
541
function Copy-File ($Src , $Dst ) {
0 commit comments