Allow older branches to be built with Visual Studio 2008. This is a backport of commit df0cdd53 to the 8.2, 8.3 and 8.4 branches.

This commit is contained in:
Andrew Dunstan 2011-01-04 16:06:30 -05:00
parent 1d1a434222
commit 5739935188
2 changed files with 25 additions and 2 deletions

View File

@ -32,7 +32,8 @@ sub new
defines => ';',
solution => $solution,
disablewarnings => '4018;4244;4273;4102;4090',
disablelinkerwarnings => ''
disablelinkerwarnings => '',
vcver => $solution->{vcver}
};
bless $self;
@ -459,7 +460,7 @@ sub WriteHeader
print $f <<EOF;
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="$self->{name}" ProjectGUID="$self->{guid}">
<VisualStudioProject ProjectType="Visual C++" Version="$self->{vcver}" Name="$self->{name}" ProjectGUID="$self->{guid}">
<Platforms><Platform Name="Win32"/></Platforms>
<Configurations>
EOF

View File

@ -20,6 +20,7 @@ sub new
options => $options,
numver => '',
strver => '',
vcver => undef,
};
bless $self;
# integer_datetimes is now the default
@ -51,9 +52,30 @@ sub new
unless $options->{wal_segsize}; # undef or 0 means default
die "Bad wal_segsize $options->{wal_segsize}"
unless grep {$_ == $options->{wal_segsize}} (1,2,4,8,16,32,64);
$self->DetermineToolVersions();
return $self;
}
sub DetermineToolVersions
{
my $self = shift;
# Determine version of vcbuild command, to set proper verison of visual studio
open(P,"vcbuild /? |") || die "vcbuild command not found";
my $line = <P>;
close(P);
if ($line !~ /^Microsoft \(R\) Visual C\+\+ Project Builder - Command Line Version (\d+)\.00\.\d+/) {
die "Unable to determine vcbuild version from first line of output!";
}
if ($1 == 8) { $self->{vcver} = '8.00' }
elsif ($1 == 9) { $self->{vcver} = '9.00' }
else { die "Unsupported version of Visual Studio: $1" }
print "Detected Visual Studio version $self->{vcver}\n";
}
# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
# Special case - if config.pl has changed, always return 1
sub IsNewer