mirror of
https://github.com/postgres/postgres.git
synced 2025-06-10 09:21:54 +03:00
Fix build failure on header generation with repetitive builds of MSVC
GenerateConfigHeader() in Solution.pm was complaining about unused define symbols even if a newer config header was not generated, causing successive build attempts with MSVC to fail. Oversight in commit 8f4fb4c. Author: Kyotaro Horiguchi Reviewed-by: Juan José Santamaría Flecha Discussion: https://postgr.es/m/20200218.160500.44393633318853097.horikyota.ntt@gmail.com
This commit is contained in:
parent
36390713a6
commit
59f9cd9dd5
@ -826,13 +826,14 @@ EOF
|
|||||||
sub GenerateConfigHeader
|
sub GenerateConfigHeader
|
||||||
{
|
{
|
||||||
my ($self, $config_header, $defines, $required) = @_;
|
my ($self, $config_header, $defines, $required) = @_;
|
||||||
my %defines_copy = %$defines;
|
|
||||||
|
|
||||||
my $config_header_in = $config_header . '.in';
|
my $config_header_in = $config_header . '.in';
|
||||||
|
|
||||||
if (IsNewer($config_header, $config_header_in) ||
|
if (IsNewer($config_header, $config_header_in) ||
|
||||||
IsNewer($config_header, __FILE__))
|
IsNewer($config_header, __FILE__))
|
||||||
{
|
{
|
||||||
|
my %defines_copy = %$defines;
|
||||||
|
|
||||||
open(my $i, '<', $config_header_in)
|
open(my $i, '<', $config_header_in)
|
||||||
|| confess "Could not open $config_header_in\n";
|
|| confess "Could not open $config_header_in\n";
|
||||||
open(my $o, '>', $config_header)
|
open(my $o, '>', $config_header)
|
||||||
@ -871,10 +872,11 @@ sub GenerateConfigHeader
|
|||||||
}
|
}
|
||||||
close($o);
|
close($o);
|
||||||
close($i);
|
close($i);
|
||||||
}
|
|
||||||
if ($required && scalar(keys %defines_copy) > 0)
|
if ($required && scalar(keys %defines_copy) > 0)
|
||||||
{
|
{
|
||||||
croak "unused defines: " . join(' ', keys %defines_copy);
|
croak "unused defines: " . join(' ', keys %defines_copy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user