Skip to content

Commit 29a8707

Browse files
authored
Merge pull request #4978 from glektarssza/chore/fixup-detection-of-msvc
Use Microsoft "best practices" for using `vswhere`
2 parents d3f0b31 + b9aa518 commit 29a8707

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

build.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ setlocal EnableDelayedExpansion
44

55
where /Q cl.exe || (
66
set __VSCMD_ARG_NO_LOGO=1
7-
for /f "tokens=*" %%i in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath') do set VS=%%i
7+
for /f "tokens=*" %%i in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath') do set VS=%%i
88
if "!VS!" equ "" (
9-
echo ERROR: Visual Studio installation not found
9+
echo ERROR: MSVC installation not found
1010
exit /b 1
1111
)
12-
call "!VS!\VC\Auxiliary\Build\vcvarsall.bat" amd64 || exit /b 1
12+
call "!VS!\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64 || exit /b 1
1313
)
1414

1515
if "%VSCMD_ARG_TGT_ARCH%" neq "x64" (
@@ -152,4 +152,4 @@ if %release_mode% EQU 0 echo: & echo Debug compiler built. Note: run "build.bat
152152

153153
del *.obj > NUL 2> NUL
154154

155-
:end_of_build
155+
:end_of_build

0 commit comments

Comments
 (0)