Merged in triton/premake-cs-fixes/cpp-framework (pull request #79)

Use the user specified target .NET framework for Managed C++ VS projects.
This commit is contained in:
Jason Perkins 2013-10-09 11:38:18 -04:00
commit 30d53ced1d
2 changed files with 29 additions and 1 deletions

View File

@ -119,6 +119,15 @@
end end
--
-- Write out the TargetFrameworkVersion property.
--
function vc2010.targetFramework(prj)
local framework = prj.framework or "4.0"
_p(2,'<TargetFrameworkVersion>v%s</TargetFrameworkVersion>', framework)
end
-- --
-- Write out the Globals property group. -- Write out the Globals property group.
-- --
@ -146,7 +155,7 @@
_p(2,'<Keyword>MakeFileProj</Keyword>') _p(2,'<Keyword>MakeFileProj</Keyword>')
else else
if isManaged then if isManaged then
_p(2,'<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>') vc2010.targetFramework(prj)
_p(2,'<Keyword>ManagedCProj</Keyword>') _p(2,'<Keyword>ManagedCProj</Keyword>')
else else
_p(2,'<Keyword>Win32Proj</Keyword>') _p(2,'<Keyword>Win32Proj</Keyword>')

View File

@ -59,6 +59,25 @@
end end
--
-- Ensure custom target framework version correct for Managed C++ projects.
--
function suite.frameworkVersionIsCorrect_onManagedC()
flags { "Managed" }
framework "4.5"
prepare()
test.capture [[
<PropertyGroup Label="Globals">
<ProjectGuid>{42B5DBC6-AE1F-903D-F75D-41E363076E92}</ProjectGuid>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>MyProject</RootNamespace>
</PropertyGroup>
]]
end
-- --
-- Omit Keyword and RootNamespace for non-Windows projects. -- Omit Keyword and RootNamespace for non-Windows projects.
-- --