Commits

Jason Perkins committed 04c74c7 Merge

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

Use the user specified target .NET framework for Managed C++ VS projects.

  • Participants
  • Parent commits 6e097da, 0719916

Comments (0)

Files changed (2)

File src/actions/vstudio/vs2010_vcxproj.lua

 
 
 --
+-- 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.
 --
 
 				_p(2,'<Keyword>MakeFileProj</Keyword>')
 			else
 				if isManaged then
-					_p(2,'<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>')
+					vc2010.targetFramework(prj)	
 					_p(2,'<Keyword>ManagedCProj</Keyword>')
 				else
 					_p(2,'<Keyword>Win32Proj</Keyword>')

File tests/actions/vstudio/vc2010/test_globals.lua

 
 
 --
+-- 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.
 --