diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 043e3318..bdd36e02 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -119,6 +119,15 @@ end +-- +-- Write out the TargetFrameworkVersion property. +-- + + function vc2010.targetFramework(prj) + local framework = prj.framework or "4.0" + _p(2,'v%s', framework) + end + -- -- Write out the Globals property group. -- @@ -146,7 +155,7 @@ _p(2,'MakeFileProj') else if isManaged then - _p(2,'v4.0') + vc2010.targetFramework(prj) _p(2,'ManagedCProj') else _p(2,'Win32Proj') diff --git a/tests/actions/vstudio/vc2010/test_globals.lua b/tests/actions/vstudio/vc2010/test_globals.lua index 174c0638..d5d52cda 100755 --- a/tests/actions/vstudio/vc2010/test_globals.lua +++ b/tests/actions/vstudio/vc2010/test_globals.lua @@ -59,6 +59,25 @@ end +-- +-- Ensure custom target framework version correct for Managed C++ projects. +-- + + function suite.frameworkVersionIsCorrect_onManagedC() + flags { "Managed" } + framework "4.5" + prepare() + test.capture [[ + + {42B5DBC6-AE1F-903D-F75D-41E363076E92} + v4.5 + ManagedCProj + MyProject + + ]] + end + + -- -- Omit Keyword and RootNamespace for non-Windows projects. --