aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG'lek Tarssza <glek@glektarssza.com>2025-03-27 14:25:20 -0600
committerG'lek Tarssza <glek@glektarssza.com>2025-03-27 14:25:20 -0600
commitb9aa51849bb2352dea83dc0c2b5a10c9ef485284 (patch)
tree176a6868eabbe3134dc0c4ffc2d20fe405bb8fb8
parentd3f0b31fcc48772f1457fa1eb487fd7afcc6d43d (diff)
Use Microsoft "best practices" for using `vswhere`
See https://github.com/microsoft/vswhere/wiki/Find-VC for more details.
-rw-r--r--build.bat8
1 files changed, 4 insertions, 4 deletions
diff --git a/build.bat b/build.bat
index a788a8c04..4c015e133 100644
--- a/build.bat
+++ b/build.bat
@@ -4,12 +4,12 @@ setlocal EnableDelayedExpansion
where /Q cl.exe || (
set __VSCMD_ARG_NO_LOGO=1
- 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
+ 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
if "!VS!" equ "" (
- echo ERROR: Visual Studio installation not found
+ echo ERROR: MSVC installation not found
exit /b 1
)
- call "!VS!\VC\Auxiliary\Build\vcvarsall.bat" amd64 || exit /b 1
+ call "!VS!\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64 || exit /b 1
)
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
del *.obj > NUL 2> NUL
-:end_of_build \ No newline at end of file
+:end_of_build