diff options
author | Oliver Schneider <oliver@assarbad.net> | 2017-03-16 01:44:43 +0300 |
---|---|---|
committer | Oliver Schneider <oliver@assarbad.net> | 2017-03-16 01:44:43 +0300 |
commit | 254f662b5f6713ec9d757deac116e7ccc8a422d8 (patch) | |
tree | 2b782c7fb445641b63562487e8d32a2a42ffbf31 /src/actions | |
parent | e6b972d4069fe63d66e59a94a789df1924e9215f (diff) |
Adding support for Visual Studio 2017 projects and solutions.
Does not add the VisualStudioVersion and MinimumVisualStudioVersion in solution
files, but VS2017 opens those fine regardless and picks them up first even when
VS2010, 2012, 2013 and VS2017 are installed as well.
Added corresponding tests and verified that all is as expected.
--HG--
branch : vs2017_support
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/vstudio/vs2005_solution.lua | 6 | ||||
-rw-r--r-- | src/actions/vstudio/vs2010_vcxproj.lua | 2 | ||||
-rw-r--r-- | src/actions/vstudio/vs2015.lua | 1 | ||||
-rw-r--r-- | src/actions/vstudio/vs2017.lua | 58 |
4 files changed, 65 insertions, 2 deletions
diff --git a/src/actions/vstudio/vs2005_solution.lua b/src/actions/vstudio/vs2005_solution.lua index b0942db..7e10ff0 100644 --- a/src/actions/vstudio/vs2005_solution.lua +++ b/src/actions/vstudio/vs2005_solution.lua @@ -40,7 +40,11 @@ function sln2005.header(sln) local action = premake.action.current() _p('Microsoft Visual Studio Solution File, Format Version %d.00', action.vstudio.solutionVersion) - _p('# Visual Studio %s', _ACTION:sub(3)) + if action.vstudio.shortSlnVersion ~= nil then + _p('# Visual Studio %s', action.vstudio.shortSlnVersion) + else + _p('# Visual Studio %s', _ACTION:sub(3)) + end end diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index dcff220..d6f9b7b 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -79,7 +79,7 @@ _p(2,'<UseDebugLibraries>%s</UseDebugLibraries>', iif(optimisation(cfg) == "Disabled","true","false")) _p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,"Unicode","MultiByte")) - local toolsets = { vs2012 = "v110", vs2013 = "v120", vs2015 = "v140" } + local toolsets = { vs2012 = "v110", vs2013 = "v120", vs2015 = "v140", vs2017 = "v141" } local toolset = toolsets[_ACTION] if toolset then _p(2,'<PlatformToolset>%s</PlatformToolset>', toolset) diff --git a/src/actions/vstudio/vs2015.lua b/src/actions/vstudio/vs2015.lua index 8fa0ca9..9a8ba02 100644 --- a/src/actions/vstudio/vs2015.lua +++ b/src/actions/vstudio/vs2015.lua @@ -53,5 +53,6 @@ solutionVersion = "12", targetFramework = "4.5.2", toolsVersion = "14.0", + shortSlnVersion = "14", } } diff --git a/src/actions/vstudio/vs2017.lua b/src/actions/vstudio/vs2017.lua new file mode 100644 index 0000000..0bc0a02 --- /dev/null +++ b/src/actions/vstudio/vs2017.lua @@ -0,0 +1,58 @@ +-- +-- vs2017.lua +-- Baseline support for Visual Studio 2017. +-- Copyright (c) 2013 Jason Perkins and the Premake project +-- + + premake.vstudio.vc2017 = {} + local vc2017 = premake.vstudio.vc2017 + local vstudio = premake.vstudio + + +--- +-- Register a command-line action for Visual Studio 2017. +--- + + newaction + { + trigger = "vs2017", + shortname = "Visual Studio 2017", + description = "Generate Microsoft Visual Studio 2017 project files", + os = "windows", + + valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" }, + + valid_languages = { "C", "C++", "C#"}, + + valid_tools = { + cc = { "msc" }, + dotnet = { "msnet" }, + }, + + onsolution = function(sln) + premake.generate(sln, "%%.sln", vstudio.sln2005.generate) + end, + + onproject = function(prj) + if premake.isdotnetproject(prj) then + premake.generate(prj, "%%.csproj", vstudio.cs2005.generate) + premake.generate(prj, "%%.csproj.user", vstudio.cs2005.generate_user) + else + premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj) + premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user) + premake.generate(prj, "%%.vcxproj.filters", vstudio.vc2010.generate_filters) + end + end, + + + oncleansolution = premake.vstudio.cleansolution, + oncleanproject = premake.vstudio.cleanproject, + oncleantarget = premake.vstudio.cleantarget, + + vstudio = { + solutionVersion = "12", + targetFramework = "4.5.2", + toolsVersion = "15.0", + shortSlnVersion = "15", + } + } |