From 68f3a6d032b0a632a898f13b6ec87033751d1bc5 Mon Sep 17 00:00:00 2001 From: triton Date: Mon, 30 Sep 2013 15:53:16 +0100 Subject: [PATCH] Use the user specified target .NET framework for Managed C++ VS projects. --- src/actions/vstudio/vs2010_vcxproj.lua | 11 ++++++++++- tests/actions/vstudio/vc2010/test_globals.lua | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 2cfd1ef2..35427aac 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. --