aboutsummaryrefslogtreecommitdiff
path: root/etc/environments/default-msvc.bat
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-15 10:54:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-15 10:54:45 +0200
commita4c0078cabe614c9ae1b99d67b67ec55413d8199 (patch)
tree7eebcda485276d58b1499a36731b49c6f55a7008 /etc/environments/default-msvc.bat
parent01a2c9fa82915628d333b00461c3003fa98fa1a6 (diff)
Update MSVC and Clang environments now that we can do prompt-less
Diffstat (limited to 'etc/environments/default-msvc.bat')
-rw-r--r--etc/environments/default-msvc.bat16
1 files changed, 13 insertions, 3 deletions
diff --git a/etc/environments/default-msvc.bat b/etc/environments/default-msvc.bat
index fcb3155..381dc73 100644
--- a/etc/environments/default-msvc.bat
+++ b/etc/environments/default-msvc.bat
@@ -8,6 +8,11 @@ rem
rem Environment setup script for C/C++ compilation with Visual Studio.
rem
+rem If the MSVC and VCVARS variables are set, then set up the environment via
+rem the MSVC command prompt rather than letting build2 find the default.
+rem
+rem Note also that MSVC_VER must always be set.
+
rem set "MSVC=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
rem set "MSVC_VER=14.1"
@@ -25,8 +30,9 @@ setlocal EnableExtensions EnableDelayedExpansion
rem Based on target determine what we are building.
rem
+set "VCVARS="
if "_%1_" == "_x86_64-microsoft-win32-msvc%MSVC_VER%_" (
- set "VCVARS=%VCVARS64%"
+ rem set "VCVARS=%VCVARS64%"
) else (
if "_%1_" == "_i686-microsoft-win32-msvc%MSVC_VER%_" (
set "VCVARS=%VCVARS32%"
@@ -40,8 +46,12 @@ if "_%1_" == "_x86_64-microsoft-win32-msvc%MSVC_VER%_" (
)
)
-call "%MSVC%\%VCVARS%"
-if errorlevel 1 goto error
+if not "_%MSVC%_" == "__" (
+ if not "_%VCVARS%_" == "__" (
+ call "%MSVC%\%VCVARS%"
+ if errorlevel 1 goto error
+ )
+)
%2 %3 %4 %5 %6 %7 %8 %9 cc config.c=cl config.cxx=cl
if errorlevel 1 goto error