Skip to content
Browse files

win: vcbuild.bat should attempt to run vcvarsall.bat

  • Loading branch information...
1 parent 17021ea commit d01b87d9c44bda6f90b921ff30ca32c37c56bb98 @piscisaureus piscisaureus committed
Showing with 13 additions and 2 deletions.
  1. +13 −2 vcbuild.bat
View
15 vcbuild.bat
@@ -53,8 +53,19 @@ echo Project files generated.
@rem Skip project generation if requested.
if defined nobuild goto run
-if not defined VCINSTALLDIR echo Build skipped. To build, this file needs to run from VS cmd prompt.& goto run
-
+@rem Bail out early if not running in VS build env.
+if defined VCINSTALLDIR goto msbuild-found
+if not defined VS100COMNTOOLS goto msbuild-not-found
+if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
+call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
+if not defined VCINSTALLDIR goto msbuild-not-found
+goto msbuild-found
+
+:msbuild-not-found
+echo Build skipped. To build, this file needs to run from VS cmd prompt.
+goto run
+
+:msbuild-found
@rem Build the sln with msbuild.
msbuild node.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit

0 comments on commit d01b87d

Please sign in to comment.
Something went wrong with that request. Please try again.