From da52474f3d3cbdf38d8a6677a4ebedaf402ade3a Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Fri, 29 Apr 2016 07:59:47 -0400 Subject: Support building with Visual Studio 2015 Adjust the way we detect the locale. As a result the minumum Windows version supported by VS2015 and later is Windows Vista. Add some tweaks to remove new compiler warnings. Remove documentation references to the now obsolete msysGit. Michael Paquier, somewhat edited by me, reviewed by Christian Ullrich. Backpatch to 9.5 --- src/tools/msvc/MSBuildProject.pm | 23 +++++++++++++++++++++++ src/tools/msvc/Solution.pm | 26 ++++++++++++++++++++++++++ src/tools/msvc/VSObjectFactory.pm | 12 ++++++++++-- 3 files changed, 59 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index 3d60b64ec9c..d7638b458ef 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm @@ -465,4 +465,27 @@ sub new return $self; } +package VC2015Project; + +# +# Package that encapsulates a Visual C++ 2015 project file +# + +use strict; +use warnings; +use base qw(VC2012Project); + +sub new +{ + my $classname = shift; + my $self = $classname->SUPER::_new(@_); + bless($self, $classname); + + $self->{vcver} = '14.00'; + $self->{PlatformToolset} = 'v140'; + $self->{ToolsVersion} = '14.0'; + + return $self; +} + 1; diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 974590a9a48..7cae0beb15a 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -763,6 +763,32 @@ sub new return $self; } +package VS2015Solution; + +# +# Package that encapsulates a Visual Studio 2015 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} = '14.00'; + $self->{visualStudioName} = 'Visual Studio 2015'; + $self->{VisualStudioVersion} = '14.0.24730.2'; + $self->{MinimumVisualStudioVersion} = '10.0.40219.1'; + + return $self; +} + sub GetAdditionalHeaders { my ($self, $f) = @_; diff --git a/src/tools/msvc/VSObjectFactory.pm b/src/tools/msvc/VSObjectFactory.pm index fee4684b21d..4190ada6184 100644 --- a/src/tools/msvc/VSObjectFactory.pm +++ b/src/tools/msvc/VSObjectFactory.pm @@ -49,6 +49,10 @@ sub CreateSolution { return new VS2013Solution(@_); } + elsif ($visualStudioVersion eq '14.00') + { + return new VS2015Solution(@_); + } else { croak "The requested Visual Studio version is not supported."; @@ -84,6 +88,10 @@ sub CreateProject { return new VC2013Project(@_); } + elsif ($visualStudioVersion eq '14.00') + { + return new VC2015Project(@_); + } else { croak "The requested Visual Studio version is not supported."; @@ -112,11 +120,11 @@ sub DetermineVisualStudioVersion sub _GetVisualStudioVersion { my ($major, $minor) = @_; - if ($major > 12) + if ($major > 14) { carp "The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead."; - return '12.00'; + return '14.00'; } elsif ($major < 6) { -- cgit v1.2.3