Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan2013-02-06 19:52:29 +0000
committerAndrew Dunstan2013-02-06 19:52:29 +0000
commite1c1e2173248f39c1b15fca7b2a31ad7b5199ce7 (patch)
treedb58fc5d34d7812a88b144ce4f573fe74406e402 /src/tools/msvc/MSBuildProject.pm
parent5a1cd89f8f4a0bc13c85810de47d48bb6386ea89 (diff)
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/MSBuildProject.pm')
-rw-r--r--src/tools/msvc/MSBuildProject.pm44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm
index 2e3eab6599d..0cafd717a2b 100644
--- a/src/tools/msvc/MSBuildProject.pm
+++ b/src/tools/msvc/MSBuildProject.pm
@@ -1,7 +1,7 @@
package MSBuildProject;
#
-# Package that encapsulates a MSBuild (Visual C++ 2010) project file
+# Package that encapsulates a MSBuild project file (Visual C++ 2010 or greater)
#
# src/tools/msvc/MSBuildProject.pm
#
@@ -397,4 +397,46 @@ sub new
return $self;
}
+package VC2012Project;
+
+#
+# Package that encapsulates a Visual C++ 2012 project file
+#
+
+use strict;
+use warnings;
+use base qw(MSBuildProject);
+
+sub new
+{
+ my $classname = shift;
+ my $self = $classname->SUPER::_new(@_);
+ bless($self, $classname);
+
+ $self->{vcver} = '11.00';
+
+ return $self;
+}
+
+# This override adds the <PlatformToolset> element
+# to the PropertyGroup labeled "Configuration"
+sub WriteConfigurationPropertyGroup
+{
+ my ($self, $f, $cfgname, $p) = @_;
+ my $cfgtype =
+ ($self->{type} eq "exe")
+ ?'Application'
+ :($self->{type} eq "dll"?'DynamicLibrary':'StaticLibrary');
+
+ print $f <<EOF;
+ <PropertyGroup Condition="'\$(Configuration)|\$(Platform)'=='$cfgname|$self->{platform}'" Label="Configuration">
+ <ConfigurationType>$cfgtype</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>$p->{wholeopt}</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+EOF
+}
+
1;