From fecea54d91988cb664530d4b6398b87bf9ee018f Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Wed, 27 Apr 2016 08:57:08 +0200 Subject: [PATCH 1/2] Support passing arbitrary arguments to MSBuild/VCBuild. This is particularly useful to pass /m, to perform a parallel build. --- doc/src/sgml/install-windows.sgml | 7 +++++++ src/tools/msvc/build.pl | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index 74265fc..0097463 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 the Visual Studio build + command (msbuild or vcbuild): + +$ENV{MSBFLAGS}="/m"; + + Requirements diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index c4e4dc7..e25a689 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,15 +54,15 @@ 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) { - system("vcbuild $buildwhat.vcproj $bconf"); + system("vcbuild $msbflags $buildwhat.vcproj $bconf"); } 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