Skip to content

Commit 61358eb

Browse files
committed
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.
1 parent 744145a commit 61358eb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

build.bat

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,17 @@ REM CLEAN function: clean up the build dir before building
204204

205205
REM SETUP function: set-up the build environment
206206
:SETUP
207-
REM TODO: add some logic to detect available versions (Enterprise, Professional, Community)
208-
REM TODO: add support for vcvarsall.bat (2015)
209207
set RELEASE=2017
210-
set EDITION=Community
211-
call "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%EDITION%\Common7\Tools\VsDevCmd.bat" -arch=!TARCH!
208+
set EDITION=Professional
209+
for %%e in (Enterprise, Professional, Community) do (
210+
if exist "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%%e\Common7\Tools\VsDevCmd.bat" (
211+
if /i "%%e" == "Community" (
212+
echo WARNING: Community edition is not licensed to build commerical projects.
213+
)
214+
call "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%%e\Common7\Tools\VsDevCmd.bat" -arch=!TARCH!
215+
break
216+
)
217+
)
212218

213219
goto:eof
214220

0 commit comments

Comments
 (0)