From 7b83b99fdc1734e5710742e7efc981949585a6ee Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 31 Jan 2012 14:28:04 +0100 Subject: [PATCH] Windows: try to set up vc environment when not running from vs command prompt --- vcbuild.bat | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index bccefff9..644f574c 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -64,9 +64,21 @@ 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 If not running in the VS build env, try to start it. If that fails, bail +@rem out. +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 @rem Build the sln with msbuild. +:msbuild-found msbuild uv.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit