blob: be77c87b294a6cba9f7fef131a07faa418d6a85c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
@echo off
setlocal ENABLEEXTENSIONS
::- check for vswhere
set vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vswhere%" (
echo 1>&2 vswhere.exe not found
exit /b 1
)
::- find the latest build tool and its setup batch file.
set VSDEVCMD=
for /f "delims=" %%I in ('"%vswhere%" -products * -latest -property installationPath') do (
set VSDEVCMD=%%I\Common7\Tools\VsDevCmd.bat
)
if not defined VSDEVCMD (
echo 1>&2 Visual Studio not found
exit /b 1
)
::- default to the current processor.
set arch=%PROCESSOR_ARCHITECTURE%
::- `vsdevcmd.bat` requires arch names to be lowercase
for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do @(
call set arch=%%arch:%%i=%%i%%
)
echo on && endlocal && "%VSDEVCMD%" -arch=%arch% -host_arch=%arch% %*
|