mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
fix: restore PROCESSOR_ARCHITECTURE after VS dev shell on ARM64
VS dev shell with -HostArch amd64 sets PROCESSOR_ARCHITECTURE=AMD64, causing CMake to misdetect the system as x64 and use -march=haswell on ARM64. Restore PROCESSOR_ARCHITECTURE=ARM64 after VS dev shell.
This commit is contained in:
@@ -39,6 +39,12 @@ if($env:VSINSTALLDIR -eq $null) {
|
||||
# -HostArch only accepts "x86" or "amd64" — even on native ARM64, use "amd64"
|
||||
$hostArch = if ($script:VsArch -eq "arm64") { "amd64" } else { $script:VsArch }
|
||||
. $vsShell -Arch $script:VsArch -HostArch $hostArch
|
||||
|
||||
# VS dev shell with -HostArch amd64 sets PROCESSOR_ARCHITECTURE=AMD64,
|
||||
# which causes CMake to misdetect the system as x64. Restore it on ARM64.
|
||||
if ($script:IsARM64) {
|
||||
$env:PROCESSOR_ARCHITECTURE = "ARM64"
|
||||
}
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user