From def9ef5a7b123aa536345a6dbe1d6354d1475992 Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Sun, 12 Nov 2017 18:43:32 -0800 Subject: [PATCH] MSVC: Rebuild spiexceptions.h when out of date. Also, add a warning to catch future instances of naming a nonexistent file as a prerequisite. Back-patch to 9.3 (all supported versions). --- src/tools/msvc/Solution.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index cb6f9bd24f3..1d912eba241 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -87,6 +87,7 @@ sub DeterminePlatform sub IsNewer { my ($newfile, $oldfile) = @_; + -e $oldfile or warn "source file \"$oldfile\" does not exist"; if ( $oldfile ne 'src/tools/msvc/config.pl' && $oldfile ne 'src/tools/msvc/config_default.pl') { @@ -304,7 +305,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY if ($self->{options}->{python} && IsNewer( 'src/pl/plpython/spiexceptions.h', - 'src/include/backend/errcodes.txt')) + 'src/backend/utils/errcodes.txt')) { print "Generating spiexceptions.h...\n"; system(