MSVC: Pass any user-set MSBFLAGS to MSBuild and VCBUILD.
authorNoah Misch <noah@leadboat.com>
Thu, 8 Sep 2016 05:42:09 +0000 (01:42 -0400)
committerNoah Misch <noah@leadboat.com>
Thu, 8 Sep 2016 05:42:09 +0000 (01:42 -0400)
This is particularly useful to pass /m, to perform a parallel build.

Christian Ullrich, reviewed by Michael Paquier.

doc/src/sgml/install-windows.sgml
src/tools/msvc/build.pl
src/tools/msvc/clean.bat
src/tools/msvc/vcregress.pl

index 8cd189c8e15f81e6aecc7e10c4720281b4adf5dd..50116f315dccf8ef58aec5116c07990625aeddd3 100644 (file)
@@ -145,6 +145,14 @@ $ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin';
 </programlisting>
  </para>
 
+ <para>
+  To pass additional command line arguments to the Visual Studio build
+  command (msbuild or vcbuild):
+<programlisting>
+$ENV{MSBFLAGS}="/m";
+</programlisting>
+ </para>
+
  <sect2>
   <title>Requirements</title>
   <para>
index 007e3c73b25261f8898e641169122d0189619042..52739774c792eba6b5581ee350d0cbf7707e4fef 100644 (file)
@@ -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,16 +54,16 @@ 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
index 469b8a24b29848127bb8a27a5cdc528910d04588..e21e37f6f768a5940b3528e9a7504d6c077093f5 100755 (executable)
@@ -107,6 +107,6 @@ REM for /r %%f in (*.sql) do if exist %%f.in del %%f
 cd %D%
 
 REM Clean up ecpg regression test files
-msbuild /NoLogo ecpg_regression.proj /t:clean /v:q
+msbuild %MSBFLAGS% /NoLogo ecpg_regression.proj /t:clean /v:q
 
 goto :eof
index b4f946474f509c2421cd386588d76a260fe35447..bcf22677acdf1c2981f78f5097e594b0875041af 100644 (file)
@@ -138,8 +138,9 @@ sub check
 
 sub ecpgcheck
 {
+   my $msbflags  = $ENV{MSBFLAGS} || "";
    chdir $startdir;
-   system("msbuild ecpg_regression.proj /p:config=$Config");
+   system("msbuild ecpg_regression.proj $msbflags /p:config=$Config");
    my $status = $? >> 8;
    exit $status if $status;
    InstallTemp();