You can definitely do something like that, I was just hoping it'd be a simple single-line add thing.
Here's what that would look like
Shell.bat's environment setup call would look like:
| if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
set VC_SCRIPT="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
) else (
set VC_SCRIPT="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
)
call %VC_SCRIPT% x64
|
and right at the beginning of build.bat, you might have something like this:
| @echo off
if exist "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" set VS2015_OPTS=-Wv:18 -wd4244
set CommonCompilerFlags=-Od -MTd -nologo -fp:fast -fp:except- -Gm- -GR- -EHa- -Zo -Oi %VS2015_OPTS% -WX -W4 -wd4201 -wd4100 -wd4189 -wd4505 -wd4127 -FC -Z7
|
(edit: oops, martins had already answered you (of course :D) while I was falling down the
batch script rat hole)