Skip to content

Commit d01b87d

Browse files
committed
win: vcbuild.bat should attempt to run vcvarsall.bat
1 parent 17021ea commit d01b87d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

vcbuild.bat

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,19 @@ echo Project files generated.
5353
@rem Skip project generation if requested.
5454
if defined nobuild goto run
5555

56-
if not defined VCINSTALLDIR echo Build skipped. To build, this file needs to run from VS cmd prompt.& goto run
57-
56+
@rem Bail out early if not running in VS build env.
57+
if defined VCINSTALLDIR goto msbuild-found
58+
if not defined VS100COMNTOOLS goto msbuild-not-found
59+
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
60+
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
61+
if not defined VCINSTALLDIR goto msbuild-not-found
62+
goto msbuild-found
63+
64+
:msbuild-not-found
65+
echo Build skipped. To build, this file needs to run from VS cmd prompt.
66+
goto run
67+
68+
:msbuild-found
5869
@rem Build the sln with msbuild.
5970
msbuild node.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
6071
if errorlevel 1 goto exit

0 commit comments

Comments
 (0)