From 61358eba61e5bc5453f9863f62827604b3321337 Mon Sep 17 00:00:00 2001 From: Bogdan Pintea Date: Fri, 20 Apr 2018 13:42:15 +0200 Subject: [PATCH] change default of MSVC edition to build with Build script will iterate on Ent, Pro or Community, to find an installation to prepare the environment with. If Community is used, it'll warn about its license. --- build.bat | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build.bat b/build.bat index a1697593..0e96d940 100644 --- a/build.bat +++ b/build.bat @@ -204,11 +204,17 @@ REM CLEAN function: clean up the build dir before building REM SETUP function: set-up the build environment :SETUP - REM TODO: add some logic to detect available versions (Enterprise, Professional, Community) - REM TODO: add support for vcvarsall.bat (2015) set RELEASE=2017 - set EDITION=Community - call "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%EDITION%\Common7\Tools\VsDevCmd.bat" -arch=!TARCH! + set EDITION=Professional + for %%e in (Enterprise, Professional, Community) do ( + if exist "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%%e\Common7\Tools\VsDevCmd.bat" ( + if /i "%%e" == "Community" ( + echo WARNING: Community edition is not licensed to build commerical projects. + ) + call "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%%e\Common7\Tools\VsDevCmd.bat" -arch=!TARCH! + break + ) + ) goto:eof