Skip to content

Commit 8182ec0

Browse files
greenjavajoaocgreis
authored andcommitted
build: add option to select VS version
This changes vcbuild.bat to accept a new parameter (vc2015 or vc2013) to select the version of Visual Studio to use. PR-URL: #4645 Reviewed-By: João Reis <[email protected]>
1 parent d91646b commit 8182ec0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vcbuild.bat

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if /i "%1"=="/?" goto help
1515
set config=Release
1616
set target=Build
1717
set target_arch=x86
18+
set target_env=
1819
set noprojgen=
1920
set nobuild=
2021
set nosign=
@@ -44,6 +45,8 @@ if /i "%1"=="clean" set target=Clean&goto arg-ok
4445
if /i "%1"=="ia32" set target_arch=x86&goto arg-ok
4546
if /i "%1"=="x86" set target_arch=x86&goto arg-ok
4647
if /i "%1"=="x64" set target_arch=x64&goto arg-ok
48+
if /i "%1"=="vc2013" set target_env=vc2013&goto arg-ok
49+
if /i "%1"=="vc2015" set target_env=vc2015&goto arg-ok
4750
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
4851
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
4952
if /i "%1"=="nosign" set nosign=1&goto arg-ok
@@ -110,6 +113,7 @@ call :getnodeversion || exit /b 1
110113

111114
@rem Set environment for msbuild
112115

116+
if defined target_env if "%target_env%" NEQ "vc2015" goto vc-set-2013
113117
@rem Look for Visual Studio 2015
114118
echo Looking for Visual Studio 2015
115119
if not defined VS140COMNTOOLS goto vc-set-2013
@@ -133,6 +137,7 @@ set PLATFORM_TOOLSET=v140
133137
goto msbuild-found
134138

135139
:vc-set-2013
140+
if defined target_env if "%target_env%" NEQ "vc2013" goto msbuild-not-found
136141
@rem Look for Visual Studio 2013
137142
echo Looking for Visual Studio 2013
138143
if not defined VS120COMNTOOLS goto msbuild-not-found
@@ -262,7 +267,7 @@ echo Failed to create vc project files.
262267
goto exit
263268

264269
:help
265-
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [download-all] [enable-vtune]
270+
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune]
266271
echo Examples:
267272
echo vcbuild.bat : builds release build
268273
echo vcbuild.bat debug : builds debug build

0 commit comments

Comments
 (0)