aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2011-01-04 16:07:05 -0500
committerAndrew Dunstan <andrew@dunslane.net>2011-01-04 16:07:05 -0500
commitebbf741d5d449f6fdc1983aca54d1f232d866b16 (patch)
tree121b0a74fec6b426ac38f7f254663e45794d05df /src
parent3be03bae2c4c2b5035cef40be33e9ac688cafe17 (diff)
downloadpostgresql-ebbf741d5d449f6fdc1983aca54d1f232d866b16.tar.gz
postgresql-ebbf741d5d449f6fdc1983aca54d1f232d866b16.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/msvc/Project.pm3
-rw-r--r--src/tools/msvc/Solution.pm25
2 files changed, 26 insertions, 2 deletions
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index fa466c79882..3d09e643302 100644
--- a/src/tools/msvc/Project.pm
+++ b/src/tools/msvc/Project.pm
@@ -24,6 +24,7 @@ sub new {
defines => ';',
solution => $solution,
disablewarnings => '4018;4244',
+ vcver => $solution->{vcver}
};
bless $self;
@@ -337,7 +338,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
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 3431ca2e6df..6a30253ab2e 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -12,11 +12,34 @@ sub new {
options => $options,
numver => '',
strver => '',
+ vcver => undef,
};
bless $self;
- return $self;
+
+ $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 {