Skip to content

Commit

Permalink
Set vcvars for cross-toolchain when targetting arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-turney authored and nirbheek committed Apr 24, 2020
1 parent 2087b20 commit d107c42
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion win32/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ if ($Compiler -eq 'msvc2019') {
## hack to extract the environment from vcvarsall.bat
Remove-Item env:BUILD_SOURCEVERSIONMESSAGE

# arch for the vcvars script includes the host when cross-compiling
$vcarch = $env:arch
if ($env:arch -eq 'arm64') {
$vcarch = "amd64_arm64"
}

## ask cmd.exe to output the environment table after the batch file completes
$tempFile = [IO.Path]::GetTempFileName()
cmd /c " `"$vcvars`" $env:arch && set > `"$tempFile`" "
cmd /c " `"$vcvars`" $vcarch && set > `"$tempFile`" "

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

0 comments on commit d107c42

Please sign in to comment.