2013-04-25 13:59:55 +00:00
|
|
|
--
|
2013-04-25 15:45:44 +00:00
|
|
|
-- actions/vstudio/vs2012.lua
|
|
|
|
-- Extend the existing exporters with support for Visual Studio 2012.
|
2013-04-25 13:59:55 +00:00
|
|
|
-- Copyright (c) 2013 Jason Perkins and the Premake project
|
|
|
|
--
|
|
|
|
|
|
|
|
local vstudio = premake.vstudio
|
2013-04-25 20:05:08 +00:00
|
|
|
local cs2005 = vstudio.cs2005
|
2013-04-25 15:45:44 +00:00
|
|
|
local vc2010 = vstudio.vc2010
|
2013-04-25 13:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
---
|
2013-05-22 15:15:48 +00:00
|
|
|
-- Define the Visual Studio 2010 export action.
|
2013-04-25 13:59:55 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
newaction {
|
|
|
|
-- Metadata for the command line and help system
|
2013-05-02 15:21:23 +00:00
|
|
|
|
2013-04-25 13:59:55 +00:00
|
|
|
trigger = "vs2012",
|
|
|
|
shortname = "Visual Studio 2012",
|
|
|
|
description = "Generate Visual Studio 2012 project files",
|
|
|
|
|
|
|
|
-- Visual Studio always uses Windows path and naming conventions
|
2013-05-02 15:21:23 +00:00
|
|
|
|
2013-04-25 13:59:55 +00:00
|
|
|
os = "windows",
|
|
|
|
|
|
|
|
-- The capabilities of this action
|
2013-05-02 15:21:23 +00:00
|
|
|
|
2013-06-26 11:28:57 +00:00
|
|
|
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Makefile", "None" },
|
2013-04-25 13:59:55 +00:00
|
|
|
valid_languages = { "C", "C++", "C#" },
|
|
|
|
valid_tools = {
|
|
|
|
cc = { "msc" },
|
|
|
|
dotnet = { "msnet" },
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Solution and project generation logic
|
2013-05-02 15:21:23 +00:00
|
|
|
|
|
|
|
onsolution = vstudio.vs2005.generateSolution,
|
|
|
|
onproject = vstudio.vs2010.generateProject,
|
|
|
|
|
|
|
|
oncleansolution = vstudio.cleanSolution,
|
|
|
|
oncleanproject = vstudio.cleanProject,
|
|
|
|
oncleantarget = vstudio.cleanTarget,
|
2013-04-25 13:59:55 +00:00
|
|
|
|
|
|
|
-- This stuff is specific to the Visual Studio exporters
|
2013-05-02 15:21:23 +00:00
|
|
|
|
2013-04-25 20:05:08 +00:00
|
|
|
vstudio = {
|
|
|
|
solutionVersion = "12",
|
|
|
|
targetFramework = "4.5",
|
|
|
|
toolsVersion = "4.0",
|
|
|
|
}
|
2013-04-25 13:59:55 +00:00
|
|
|
}
|
2013-04-25 15:45:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
-- Add new elements to the configuration properties block of C++ projects.
|
2013-05-02 15:21:23 +00:00
|
|
|
---
|
2013-04-25 15:45:44 +00:00
|
|
|
|
|
|
|
table.insertafter(vc2010.elements.configurationProperties, "characterSet", "platformToolset")
|
|
|
|
|
|
|
|
function vc2010.platformToolset(cfg)
|
|
|
|
if _ACTION > "vs2010" then
|
|
|
|
_p(2,'<PlatformToolset>v110</PlatformToolset>')
|
|
|
|
end
|
|
|
|
end
|
2013-04-25 20:05:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Add a common properties import statement to the top of C# projects.
|
|
|
|
--
|
|
|
|
|
|
|
|
table.insertafter(cs2005.elements.project, "projectElement", "commonProperties")
|
|
|
|
|
|
|
|
function cs2005.commonProperties(prj)
|
|
|
|
if _ACTION > "vs2010" then
|
|
|
|
_p(1,'<Import Project="$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props" Condition="Exists(\'$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\')" />')
|
|
|
|
end
|
|
|
|
end
|