diff options
author | Tyler Szabo <tyler.szabo@gmail.com> | 2018-10-09 19:59:44 -0700 |
---|---|---|
committer | Tyler Szabo <tyler.szabo@gmail.com> | 2018-10-12 16:34:05 -0700 |
commit | 82df6d60b5004311e188710865e084fe51feb33d (patch) | |
tree | 97e69fe6a4f60041734635a059a5f9be19ff4090 /tools/buildsteps/windows | |
parent | f8cb6be343293eab16de684a5243eee7426d01d8 (diff) |
[tools] windows: prevent env corruption from multiple vswhere.cmd calls
Diffstat (limited to 'tools/buildsteps/windows')
-rw-r--r-- | tools/buildsteps/windows/vswhere.bat | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/buildsteps/windows/vswhere.bat b/tools/buildsteps/windows/vswhere.bat index 7c8e7c0133..e717373b4a 100644 --- a/tools/buildsteps/windows/vswhere.bat +++ b/tools/buildsteps/windows/vswhere.bat @@ -1,5 +1,19 @@ @ECHO OFF +IF "%1"=="" ( + ECHO ERROR! vswhere.bat: architecture not specified + EXIT /B 1 +) + +REM running vcvars more than once can cause problems; exit early if using the same configuration, error if different +IF "%VSWHERE_SET%"=="%*" ( + ECHO vswhere.bat: VC vars already configured for %VSWHERE_SET% + GOTO :EOF +) +IF "%VSWHERE_SET%" NEQ "" ( + ECHO ERROR! vswhere.bat: VC vars are configured for %VSWHERE_SET% + EXIT /B 1 +) REM Trick to make the path absolute PUSHD %~dp0\..\..\..\project\BuildDependencies @@ -63,4 +77,6 @@ IF ERRORLEVEL 1 ( ECHO "ERROR! something went wrong when calling" ECHO %vcvars% %vcarch% %vcstore% %sdkver% EXIT /B 1 -)
\ No newline at end of file +) + +SET VSWHERE_SET=%* |