Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit df0cdd5

Browse files
committed
Add basic build support for Visual Studio 2008, without resorting to
generating the build files for 2005 and then converting them.
1 parent 4e766f2 commit df0cdd5

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

src/tools/msvc/Project.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Project;
33
#
44
# Package that encapsulates a Visual C++ project file generation
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.21 2009/11/12 00:13:00 tgl Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.22 2009/12/23 13:27:04 mha Exp $
77
#
88
use Carp;
99
use strict;
@@ -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;
@@ -458,7 +459,7 @@ sub WriteHeader
458459

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

src/tools/msvc/Solution.pm

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Solution;
33
#
44
# Package that encapsulates a Visual C++ solution file generation
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.48 2009/09/19 05:56:50 adunstan Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.49 2009/12/23 13:27:04 mha Exp $
77
#
88
use Carp;
99
use strict;
@@ -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)