From 7bcd86a9d2320568707f42153953b4c2808223d0 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Tue, 28 Jan 2025 23:14:03 +0100 Subject: [PATCH] deps.windows: Fix architecture mismatch when building on ARM64 host --- deps.windows/40-detours.ps1 | 2 +- utils.pwsh/Setup-Host.ps1 | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/deps.windows/40-detours.ps1 b/deps.windows/40-detours.ps1 index d1230d76d..c63ae4ea8 100644 --- a/deps.windows/40-detours.ps1 +++ b/deps.windows/40-detours.ps1 @@ -40,7 +40,7 @@ function Build { Target = $Target } - if ( $Target -eq 'x86' ) { + if ( $env:CI -ne $null -and $Target -eq 'x86' ) { $Params += @{ HostArchitecture = $Target } diff --git a/utils.pwsh/Setup-Host.ps1 b/utils.pwsh/Setup-Host.ps1 index e08ad0a8c..ff95b3e7d 100644 --- a/utils.pwsh/Setup-Host.ps1 +++ b/utils.pwsh/Setup-Host.ps1 @@ -35,11 +35,4 @@ function Cleanup { Log-Debug "Running Cleanup actions" } -function Get-HostArchitecture { - $Host64Bit = [System.Environment]::Is64BitOperatingSystem - $HostArchitecture = ('x86', 'x64')[$Host64Bit] - - return $HostArchitecture -} - -$script:HostArchitecture = Get-HostArchitecture +$script:HostArchitecture = ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture).ToString().ToLower()