8000 Allow older branches to be built with Visual Studio 2008. This is a b… · machack666/postgres@5739935 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5739935

Browse files
committed
Allow older branches to be built with Visual Studio 2008. This is a backport of commit df0cdd5 to the 8.2, 8.3 and 8.4 branches.
1 parent 1d1a434 commit 5739935

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/tools/msvc/Project.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ sub new
3232
defines => ';',
3333
solution => $solution,
3434
disablewarnings => '4018;4244;4273;4102;4090',
35-
disablelinkerwarnings => ''
35+
disablelinkerwarnings => '',
36+
vcver => $solution->{vcver}
3637
};
3738

3839
bless $self;
@@ -459,7 +460,7 @@ sub WriteHeader
459460

460461
print $f <<EOF;
461462
<?xml version="1.0" encoding="Windows-1252"?>
462-
<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="$self->{name}" ProjectGUID="$self->{guid}">
463+
<VisualStudioProject ProjectType="Visual C++" Version="$self->{vcver}" Name="$self->{name}" ProjectGUID="$self->{guid}">
463464
<Platforms><Platform Name="Win32"/></Platforms>
464465
<Configurations>
465466
EOF

src/tools/msvc/Solution.pm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ sub new
2020
options => $options,
2121
numver => '',
2222
strver => '',
23+
vcver => undef,
2324
};
2425
bless $self;
2526
# integer_datetimes is now the default
@@ -51,9 +52,30 @@ sub new
5152
unless $options->{wal_segsize}; # undef or 0 means default
5253
die "Bad wal_segsize $options->{wal_segsize}"
5354
unless grep {$_ == $options->{wal_segsize}} (1,2,4,8,16,32,64);
55+
56+
$self->DetermineToolVersions();
57+
5458
return $self;
5559
}
5660

61+
sub DetermineToolVersions
62+
{
63+
my $self = shift;
64+
65+
# Determine version of vcbuild command, to set proper verison of visual studio
66+
open(P,"vcbuild /? |") || die "vcbuild command not found";
67+
my $line = <P>;
68+
close(P);
69+
if ($line !~ /^Microsoft \(R\) Visual C\+\+ Project Builder - Command Line Version (\d+)\.00\.\d+/) {
70+
die "Unable to determine vcbuild version from first line of output!";
71+
}
72+
if ($1 == 8) { $self->{vcver} = '8.00' }
73+
elsif ($1 == 9) { $self->{vcver} = '9.00' }
74+
else { die "Unsupported version of Visual Studio: $1" }
75+
print "Detected Visual Studio version $self->{vcver}\n";
76+
}
77+
78+
5779
# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
5880
# Special case - if config.pl has changed, always return 1
5981
sub IsNewer

0 commit comments

Comments
 (0)
0