From 3c1971de878bb3658c38b0504f314d38b6b765d2 Mon Sep 17 00:00:00 2001 From: Alon Bar-Lev Date: Sat, 24 Mar 2012 09:58:36 +0200 Subject: build: msvc: upgrade to Visual Studio 2010 + fixups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alon Bar-Lev Acked-by: Samuli Seppänen Signed-off-by: David Sommerseth --- msvc-build.bat | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'msvc-build.bat') diff --git a/msvc-build.bat b/msvc-build.bat index 02a396c..01417d1 100644 --- a/msvc-build.bat +++ b/msvc-build.bat @@ -1,23 +1,37 @@ @echo off - rem Copyright (C) 2008-2012 Alon Bar-Lev -call msvc-env.bat - @rem this stupid command needed for SetEnv.cmd to operate setlocal ENABLEDELAYEDEXPANSION +call msvc-env.bat + set PLATFORMS=Win32 set CONFIGURATIONS=Release -call "%VCHOME%\bin\vcvars32.bat" +if exist "%VCHOME%\vcvarsall.bat" ( + call "%VCHOME%\vcvarsall.bat" +) else if exist "%VCHOME%\bin\vcvars32.bat" ( + call "%VCHOME%\bin\vcvars32.bat" +) else ( + echo Cannot detect visual studio + goto error +) + +msbuild /help > nul 2>&1 +if errorlevel 1 set DO_VCBUILD=1 for %%p in (%PLATFORMS%) do ( for %%c in (%CONFIGURATIONS%) do ( rmdir /q /s %SOURCEBASE%\%%p\%%c > nul 2>&1 - vcbuild /errfile:error.log /showenv %SOLUTION% /rebuild /platform:%%p "%%c|%%p" - for %%f in (error.log) do if %%~zf GTR 0 goto error + if "%DO_VCBUILD%" NEQ "" ( + vcbuild /errfile:error.log /showenv "%SOLUTION%" /rebuild /platform:%%p "%%c|%%p" + for %%f in (error.log) do if %%~zf GTR 0 goto error + ) else ( + msbuild "%SOLUTION%" /p:Configuration="%%c" /p:Platform="%%p" + if errorlevel 1 goto error + ) ) ) @@ -25,7 +39,6 @@ exit /b 0 goto end :error -if "%1" NEQ "batch" pause exit /b 1 goto end -- cgit