Skip to content

Commit e583ffe

Browse files
committed
Unbreak MSVC builds after recent Makefile refactoring.
Based on a suggestion by Peter Eisentraut.
1 parent 4816d2e commit e583ffe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/tools/msvc/pgbison.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
local $/ = undef;
4343
$make = <$mf>;
4444
close($mf);
45-
my $headerflag = ($make =~ /\$\(BISON\)\s+-d/ ? '-d' : '');
45+
my $basetarg = basename($output);
46+
my $headerflag = ($make =~ /^$basetarg:\s+BISONFLAGS\b.*-d/m ? '-d' : '');
4647

4748
system("bison $headerflag $input -o $output");
4849
exit $? >> 8;

src/tools/msvc/pgflex.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
local $/ = undef;
4545
$make = <$mf>;
4646
close($mf);
47-
my $flexflags = ($make =~ /^\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : '');
47+
my $basetarg = basename($output);
48+
my $flexflags = ($make =~ /^$basetarg:\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : '');
4849

4950
system("flex $flexflags -o$output $input");
5051
if ($? == 0)

0 commit comments

Comments
 (0)