From 62d25256f13d067f3150200efba38b7ec5102327 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 18 Apr 2007 10:14:06 +0000 Subject: [PATCH] Change default build to release, to be consistent with unix build. Make it possible to set the default from builenv.bat. Per request from Dave Page --- doc/src/sgml/install-win32.sgml | 17 ++++++++++++----- src/tools/msvc/build.bat | 23 ++++++++++++++++------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/doc/src/sgml/install-win32.sgml b/doc/src/sgml/install-win32.sgml index f2fbdb8440..a304df09f3 100644 --- a/doc/src/sgml/install-win32.sgml +++ b/doc/src/sgml/install-win32.sgml @@ -1,4 +1,4 @@ - + Installation on <productname>Windows</productname> @@ -186,17 +186,17 @@ Building - To build all of PostgreSQL in debug configuration (the default), run the + To build all of PostgreSQL in release configuration (the default), run the command: build - To build all of PostgreSQL in release configuration, run the command: + To build all of PostgreSQL in debug configuration, run the command: - build RELEASE + build DEBUG To build just a single project, for example psql, run the commands: @@ -205,7 +205,14 @@ build psql - build RELEASE psql + build DEBUG psql + + + To change the default build configuration to debug, put the following + in the buildenv.bat file: + + + set CONFIG=Debug diff --git a/src/tools/msvc/build.bat b/src/tools/msvc/build.bat index e4306356c2..e08c4964d7 100755 --- a/src/tools/msvc/build.bat +++ b/src/tools/msvc/build.bat @@ -1,8 +1,9 @@ @echo off -REM $PostgreSQL: pgsql/src/tools/msvc/build.bat,v 1.7 2007/03/17 14:01:01 mha Exp $ +REM $PostgreSQL: pgsql/src/tools/msvc/build.bat,v 1.8 2007/04/18 10:14:06 mha Exp $ SETLOCAL SET STARTDIR=%CD% +SET CONFIG= if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat if exist buildenv.bat call buildenv.bat @@ -10,12 +11,20 @@ perl mkvcbuild.pl if errorlevel 1 goto :eof if exist ..\msvc if exist ..\..\..\src cd ..\..\.. -SET CONFIG= -if "%1" == "" set CONFIG=Debug -if "%CONFIG%" == "" if "%1" == "DEBUG" set CONFIG=Debug -if "%CONFIG%" == "" if "%1" == "RELEASE" set CONFIG=Release -if not "%CONFIG%" == "" shift -if "%CONFIG%" == "" set CONFIG=Debug +set CFG= +if "%1" == "DEBUG" ( + set CONFIG=Debug + set CFG=1 +) +if "%1" == "RELEASE" ( + set CONFIG=Release + set CFG=1 +) +if "%CONFIG%" == "" set CONFIG=Release + +if "%CFG%" == "1" shift + +echo Building %CONFIG% if "%1" == "" msbuild pgsql.sln /verbosity:detailed /p:Configuration=%CONFIG% if not "%1" == "" vcbuild %1.vcproj %CONFIG%