Skip to content

Commit

Permalink
Add MSVS 2015 toolset support
Browse files Browse the repository at this point in the history
Clone VS2013 classes to create VS2015{Solution,Project,Toolset}.

Closes #55.
  • Loading branch information
vadz committed Nov 24, 2015
1 parent 2b916e9 commit 7bb50c8
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 6 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
v1.2.6 (????-??-??)
===================

New Features
------------

- Add MSVS 2015 toolset support.

Bug fixes
---------

Expand Down
6 changes: 4 additions & 2 deletions extras/vim/bkl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ syn keyword bklGlobalStat configuration
syn keyword bklGlobalStat setting
syn keyword bklGlobalProp toolsets
syn keyword bklGlobalProp configurations
syn match bklGlobalProp "\<vs\(2003\|2005\|2008\|2010\|2012\|2013\).generate-solution\ze *=" nextgroup=bklBoolRHS skipwhite
syn match bklGlobalProp "\<vs\(2003\|2005\|2008\|2010\|2012\|2013\|2015\).generate-solution\ze *=" nextgroup=bklBoolRHS skipwhite
syn keyword bklCommonProp vs2003.solutionfile
syn keyword bklCommonProp vs2005.solutionfile
syn keyword bklCommonProp vs2008.solutionfile
syn keyword bklCommonProp vs2010.solutionfile
syn keyword bklCommonProp vs2012.solutionfile
syn keyword bklCommonProp vs2013.solutionfile
syn keyword bklCommonProp vs2015.solutionfile
syn keyword bklCommonProp gnu.makefile gnu-osx.makefile gnu-suncc.makefile

" Properties common to absolutely all targets.
Expand All @@ -50,7 +51,8 @@ syn keyword bklCommonProp vs2008.guid vs2008.projectfile contained
syn keyword bklCommonProp vs2010.guid vs2010.projectfile contained
syn keyword bklCommonProp vs2012.guid vs2012.projectfile contained
syn keyword bklCommonProp vs2013.guid vs2013.projectfile contained
syn match bklCommonProp "vs\(2003\|2005\|2008\|2010\|2012\|2013\)\.option\(\.\w\+\)\{1,2}" contained
syn keyword bklCommonProp vs2015.guid vs2015.projectfile contained
syn match bklCommonProp "vs\(2003\|2005\|2008\|2010\|2012\|2013\|2015\)\.option\(\.\w\+\)\{1,2}" contained

" Properties that can occur inside action targets only.
syn keyword bklActionProp commands outputs contained
Expand Down
50 changes: 49 additions & 1 deletion src/bkl/plugins/vs201x.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, name, guid, projectfile, deps, configs, platforms, source_pos


class VS201xToolsetBase(VSToolsetBase):
"""Base class for VS2010, VS2012 and VS2013 toolsets."""
"""Base class for VS2010, VS2012, VS2013 and VS2015 toolsets."""

#: Extension of format files
proj_extension = "vcxproj"
Expand Down Expand Up @@ -635,3 +635,51 @@ class VS2013Toolset(VS201xToolsetBase):
tools_version = "12.0"
Solution = VS2013Solution
Project = VS2013Project


class VS2015Solution(VS2010Solution):
format_version = "12.00"
# Unlike the previous versions, this one uses the numeric version and not
# the year in the comment in the solution files.
human_version = "14"

def write_header(self, file):
super(VS2015Solution, self).write_header(file)
file.write("VisualStudioVersion = 14.0.23107.0\n")
file.write("MinimumVisualStudioVersion = 10.0.40219.1\n")


class VS2015Project(VS2010Project):
version = 14


class VS2015Toolset(VS201xToolsetBase):
"""
Visual Studio 2015.
Special properties
------------------
This toolset supports the same special properties that
:ref:`ref_toolset_vs2010`. The only difference is that they are prefixed
with ``vs2015.option.`` instead of ``vs2010.option.``, i.e. the nodes are:
- ``vs2015.option.Globals.*``
- ``vs2015.option.Configuration.*``
- ``vs2015.option.*`` (this is the unnamed ``PropertyGroup`` with
global settings such as ``TargetName``)
- ``vs2015.option.ClCompile.*``
- ``vs2015.option.ResourceCompile.*``
- ``vs2015.option.Link.*``
- ``vs2015.option.Lib.*``
"""

name = "vs2015"

version = 14
proj_versions = [10, 11, 12, 14]
platform_toolset = "v140"
tools_version = "14.0"
Solution = VS2015Solution
Project = VS2015Project
4 changes: 3 additions & 1 deletion tests/projects/hello_world/hello_world.bkl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
toolsets = gnu gnu-osx gnu-suncc vs2008 vs2010 vs2012 vs2013;
toolsets = gnu gnu-osx gnu-suncc vs2008 vs2010 vs2012 vs2013 vs2015;

vs2012.solutionfile = hello_world_vs2012.sln;
vs2013.solutionfile = hello_world_vs2013.sln;
vs2015.solutionfile = hello_world_vs2015.sln;
vs2008.solutionfile = hello_world_vs2008.sln;

program hello {
Expand All @@ -11,4 +12,5 @@ program hello {

vs2012.projectfile = hello_vs2012.vcxproj;
vs2013.projectfile = hello_vs2013.vcxproj;
vs2015.projectfile = hello_vs2015.vcxproj;
}
4 changes: 3 additions & 1 deletion tests/projects/hello_world/hello_world.model
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module {
variables {
toolsets = [gnu, gnu-osx, gnu-suncc, vs2008, vs2010, vs2012, vs2013]
toolsets = [gnu, gnu-osx, gnu-suncc, vs2008, vs2010, vs2012, vs2013, vs2015]
vs2012.solutionfile = @top_srcdir/hello_world_vs2012.sln
vs2013.solutionfile = @top_srcdir/hello_world_vs2013.sln
vs2015.solutionfile = @top_srcdir/hello_world_vs2015.sln
vs2008.solutionfile = @top_srcdir/hello_world_vs2008.sln
}
targets {
Expand All @@ -11,6 +12,7 @@ module {
defines = [SALUTATION="Hello"]
vs2012.projectfile = @top_srcdir/hello_vs2012.vcxproj
vs2013.projectfile = @top_srcdir/hello_vs2013.vcxproj
vs2015.projectfile = @top_srcdir/hello_vs2015.vcxproj
sources {
file @top_srcdir/hello.c
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model/properties/set_toolsets_bad.model
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ERROR:
properties/set_toolsets_bad.bkl:1:11: variable "toolsets" (list of toolsets): expression "nonexistent" is not a valid toolset value: must be one of "gnu", "gnu-osx", "gnu-suncc", "vs2003", "vs2005", "vs2008", "vs2010", "vs2012", "vs2013"
properties/set_toolsets_bad.bkl:1:11: variable "toolsets" (list of toolsets): expression "nonexistent" is not a valid toolset value: must be one of "gnu", "gnu-osx", "gnu-suncc", "vs2003", "vs2005", "vs2008", "vs2010", "vs2012", "vs2013", "vs2015"

0 comments on commit 7bb50c8

Please sign in to comment.