forked from microsoft/wil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
call-vcvars.cmd
15 lines (12 loc) · 904 Bytes
/
call-vcvars.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@echo off
:: NOTE: Intentionally not specifying 'setlocal' as we want the side-effects of calling 'vcvars' to affect the caller
:: NOTE: This is primarily intended to be used by the build pipelines, hence the hard-coded paths, and might not be
:: generally useful. The following check is intended to help diagnose such possible issues
if NOT EXIST "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" (
echo ERROR: Could not locate 'vcvars' batch file. This script is intended to be run from a build machine & exit /B 1
)
if /I "%1"=="x86" (
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
) else if /I "%1"=="x64" (
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
) else echo ERROR: Requires one of 'x86' or 'x64' & exit /B 1