Change default build to release, to be consistent with unix build.
authorMagnus Hagander <magnus@hagander.net>
Wed, 18 Apr 2007 10:14:06 +0000 (10:14 +0000)
committerMagnus Hagander <magnus@hagander.net>
Wed, 18 Apr 2007 10:14:06 +0000 (10:14 +0000)
Make it possible to set the default from builenv.bat.

Per request from Dave Page

doc/src/sgml/install-win32.sgml
src/tools/msvc/build.bat

index 36bc14ae007967a63328800f4e9fc3aef39208a8..3a9966cd8f5c9fa6f30ad70552cbc81943a10f16 100644 (file)
   <title>Building</title>
 
   <para>
-   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:
    <screen>
     <userinput>
      build
     </userinput>
    </screen>
-   To build all of PostgreSQL in release configuration, run the command:
+   To build all of PostgreSQL in debug configuration, run the command:
    <screen>
     <userinput>
-     build RELEASE
+     build DEBUG
     </userinput>
    </screen>
    To build just a single project, for example psql, run the commands:
      build psql
     </userinput>
     <userinput>
-     build RELEASE psql
+     build DEBUG psql
+    </userinput>
+   </screen>
+   To change the default build configuration to debug, put the following
+   in the buildenv.bat file:
+   <screen>
+    <userinput>
+     set CONFIG=Debug
     </userinput>
    </screen>
   </para>
index 08c10bdb53d0b2a30e07686c3aa23ebc2ccd204f..0cc933ed56ea04e45ca4159758fcc67911e5d13a 100755 (executable)
@@ -3,6 +3,7 @@ REM $PostgreSQL$
 
 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%