diff options
| author | Michael Paquier | 2021-01-21 01:56:03 +0000 |
|---|---|---|
| committer | Michael Paquier | 2021-01-21 01:56:03 +0000 |
| commit | 733d670073efd2c3a9df07c225006668009ab793 (patch) | |
| tree | 415227a685d93f5c37245991a56e1a32b0bc78ac /src/tools | |
| parent | b663a4136331de6c7364226e3dbf7c88bfee7145 (diff) | |
Switch "cl /?" to "cl /help" in MSVC scripts for platform detection
"cl /?" produces a different output if run on a real or a virtual drive
(this can be set with a simple subst command), causing an error in the
MSVC scripts if building on a virtual drive because the platform to use
cannot be detected.
"cl /help", on the contrary, produces a consistent output if used on a
real or virtual drive. Changing to "/help" allows the compilation to
work with a virtual drive as long as the top of the code repository is
part of the drive, without impacting the build on real drives.
Reported-by: Robert Grange
Author: Juan José SantamarÃa Flecha
Discussion: https://postgr.es/m/16825-c4f104bcebc67034@postgresql.org
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/msvc/Solution.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 59a42bea97a..2f28de0355a 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -62,7 +62,7 @@ sub DeterminePlatform if ($^O eq "MSWin32") { # Examine CL help output to determine if we are in 32 or 64-bit mode. - my $output = `cl /? 2>&1`; + my $output = `cl /help 2>&1`; $? >> 8 == 0 or die "cl command not found"; $self->{platform} = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; |
