From 4b455e1ac38f1441f1faf695da4be8c5eb478970 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 26 Apr 2016 14:52:27 +0200 Subject: [PATCH 1/2] Support passing arbitrary arguments to MSBuild. This is particularly useful to pass /m, to perform a parallel build. --- doc/src/sgml/install-windows.sgml | 11 +++++++++-- src/tools/msvc/build.pl | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index 74265fc..2b9cf1a 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -137,6 +137,13 @@ $config->{python} = 'c:\python26'; $ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin'; + + To pass additional command line arguments to msbuild (Visual Studio 2010 + and later): + +$ENV{MSBFLAGS}="/m"; + + Requirements @@ -361,12 +368,12 @@ $ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin'; To build all of PostgreSQL in debug configuration, run the command: -build DEBUG +build -c DEBUG To build just a single project, for example psql, run the commands: build psql -build DEBUG psql +build -c DEBUG psql To change the default build configuration to debug, put the following in the buildenv.pl file: diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index c4e4dc7..85109a2 100644 --- a/src/tools/msvc/build.pl +++ b/src/tools/msvc/build.pl @@ -38,6 +38,7 @@ my $vcver = Mkvcbuild::mkvcbuild($config); # check what sort of build we are doing my $bconf = $ENV{CONFIG} || "Release"; +my $msbflags = $ENV{MSBFLAGS} || ""; my $buildwhat = $ARGV[1] || ""; if (uc($ARGV[0]) eq 'DEBUG') { @@ -53,7 +54,7 @@ elsif (uc($ARGV[0]) ne "RELEASE") if ($buildwhat and $vcver >= 10.00) { system( -"msbuild $buildwhat.vcxproj /verbosity:normal /p:Configuration=$bconf"); +"msbuild $buildwhat.vcxproj $msbflags /verbosity:normal /p:Configuration=$bconf"); } elsif ($buildwhat) { @@ -61,7 +62,7 @@ elsif ($buildwhat) } else { - system("msbuild pgsql.sln /verbosity:normal /p:Configuration=$bconf"); + system("msbuild pgsql.sln $msbflags /verbosity:normal /p:Configuration=$bconf"); } # report status -- 2.8.1.windows.1