summaryrefslogtreecommitdiff
path: root/src/tools/msvc/Solution.pm
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2013-02-06 14:52:29 -0500
committerAndrew Dunstan <andrew@dunslane.net>2013-02-06 14:52:29 -0500
commite1c1e2173248f39c1b15fca7b2a31ad7b5199ce7 (patch)
treedb58fc5d34d7812a88b144ce4f573fe74406e402 /src/tools/msvc/Solution.pm
parent5a1cd89f8f4a0bc13c85810de47d48bb6386ea89 (diff)
downloadpostgresql-e1c1e2173248f39c1b15fca7b2a31ad7b5199ce7.tar.gz
Enable building with Microsoft Visual Studio 2012.
Backpatch to release 9.2 Brar Piening and Noah Misch, reviewed by Craig Ringer.
Diffstat (limited to 'src/tools/msvc/Solution.pm')
-rw-r--r--src/tools/msvc/Solution.pm31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 850a1dfabc..e271ac8d9b 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -63,13 +63,12 @@ sub DeterminePlatform
{
my $self = shift;
- # Determine if we are in 32 or 64-bit mode. Do this by seeing if CL has
- # 64-bit only parameters.
+ # Examine CL help output to determine if we are in 32 or 64-bit mode.
$self->{platform} = 'Win32';
- open(P, "cl /? 2>NUL|") || die "cl command not found";
+ open(P, "cl /? 2>&1 |") || die "cl command not found";
while (<P>)
{
- if (/^\/favor:</)
+ if (/^\/favor:<.+AMD64/)
{
$self->{platform} = 'x64';
last;
@@ -700,4 +699,28 @@ sub new
return $self;
}
+package VS2012Solution;
+
+#
+# Package that encapsulates a Visual Studio 2012 solution file
+#
+
+use Carp;
+use strict;
+use warnings;
+use base qw(Solution);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{solutionFileVersion} = '12.00';
+ $self->{vcver} = '11.00';
+ $self->{visualStudioName} = 'Visual Studio 2012';
+
+ return $self;
+}
+
1;