Skip to content

Commit d107c42

Browse files
jon-turneynirbheek
authored andcommitted
Set vcvars for cross-toolchain when targetting arm64
1 parent 2087b20 commit d107c42

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

win32/install.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ if ($Compiler -eq 'msvc2019') {
7171
## hack to extract the environment from vcvarsall.bat
7272
Remove-Item env:BUILD_SOURCEVERSIONMESSAGE
7373

74+
# arch for the vcvars script includes the host when cross-compiling
75+
$vcarch = $env:arch
76+
if ($env:arch -eq 'arm64') {
77+
$vcarch = "amd64_arm64"
78+
}
79+
7480
## ask cmd.exe to output the environment table after the batch file completes
7581
$tempFile = [IO.Path]::GetTempFileName()
76-
cmd /c " `"$vcvars`" $env:arch && set > `"$tempFile`" "
82+
cmd /c " `"$vcvars`" $vcarch && set > `"$tempFile`" "
7783

7884
## go through the environment variables in the temp file.
7985
## for each of them, set the variable in our local environment.

0 commit comments

Comments
 (0)