mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Allow running src/tools/msvc/mkvcbuild.pl under not Windows
This to allow verifying the MSVC build file generation without having to have Windows. To do this, we avoid Windows-specific Perl modules and don't run the "cl" compiler or "nmake". The resulting build files won't actually be completely correct, but it's useful enough. Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/d73b2c7b-f081-8357-8422-7564d55f1aac%402ndquadrant.com
This commit is contained in:
@ -111,21 +111,28 @@ sub CreateProject
|
||||
|
||||
sub DetermineVisualStudioVersion
|
||||
{
|
||||
|
||||
# To determine version of Visual Studio we use nmake as it has
|
||||
# existed for a long time and still exists in current Visual
|
||||
# Studio versions.
|
||||
my $output = `nmake /? 2>&1`;
|
||||
$? >> 8 == 0
|
||||
or croak
|
||||
"Unable to determine Visual Studio version: The nmake command wasn't found.";
|
||||
if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?$/m)
|
||||
if ($^O eq "MSWin32")
|
||||
{
|
||||
return _GetVisualStudioVersion($1, $2);
|
||||
}
|
||||
# To determine version of Visual Studio we use nmake as it has
|
||||
# existed for a long time and still exists in current Visual
|
||||
# Studio versions.
|
||||
my $output = `nmake /? 2>&1`;
|
||||
$? >> 8 == 0
|
||||
or croak
|
||||
"Unable to determine Visual Studio version: The nmake command wasn't found.";
|
||||
if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?$/m)
|
||||
{
|
||||
return _GetVisualStudioVersion($1, $2);
|
||||
}
|
||||
|
||||
croak
|
||||
"Unable to determine Visual Studio version: The nmake version could not be determined.";
|
||||
croak
|
||||
"Unable to determine Visual Studio version: The nmake version could not be determined.";
|
||||
}
|
||||
else
|
||||
{
|
||||
# fake version
|
||||
return '16.00';
|
||||
}
|
||||
}
|
||||
|
||||
sub _GetVisualStudioVersion
|
||||
|
Reference in New Issue
Block a user