diff options
author | Michael Paquier <michael@paquier.xyz> | 2020-02-25 13:57:40 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2020-02-25 13:57:40 +0900 |
commit | 59f9cd9dd5e4db8c59c57a17388c17564a3211a3 (patch) | |
tree | d3bdbb37709de4b2fae28733824c12821d317da6 | |
parent | 36390713a60f446da7e7ae758771c9104fa89394 (diff) | |
download | postgresql-59f9cd9dd5e4db8c59c57a17388c17564a3211a3.tar.gz postgresql-59f9cd9dd5e4db8c59c57a17388c17564a3211a3.zip |
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
-rw-r--r-- | src/tools/msvc/Solution.pm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 75f916399c0..6b4a6eec2a4 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -826,13 +826,14 @@ EOF sub GenerateConfigHeader { my ($self, $config_header, $defines, $required) = @_; - my %defines_copy = %$defines; my $config_header_in = $config_header . '.in'; if (IsNewer($config_header, $config_header_in) || IsNewer($config_header, __FILE__)) { + my %defines_copy = %$defines; + open(my $i, '<', $config_header_in) || confess "Could not open $config_header_in\n"; open(my $o, '>', $config_header) @@ -871,10 +872,11 @@ sub GenerateConfigHeader } close($o); close($i); - } - if ($required && scalar(keys %defines_copy) > 0) - { - croak "unused defines: " . join(' ', keys %defines_copy); + + if ($required && scalar(keys %defines_copy) > 0) + { + croak "unused defines: " . join(' ', keys %defines_copy); + } } } |