From 9fe297f5bb46c1e8079beefb4cdec8dd22c483e6 Mon Sep 17 00:00:00 2001 From: John Norman Date: Thu, 6 Jan 2022 01:40:44 -0800 Subject: [PATCH] Reduced redundant code and added another test case. --- .../tests/vc2022/test_compile_settings.lua | 13 +++++++++++++ modules/vstudio/vs2010_vcxproj.lua | 15 ++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/vstudio/tests/vc2022/test_compile_settings.lua b/modules/vstudio/tests/vc2022/test_compile_settings.lua index 39c711e0..d6920916 100644 --- a/modules/vstudio/tests/vc2022/test_compile_settings.lua +++ b/modules/vstudio/tests/vc2022/test_compile_settings.lua @@ -147,3 +147,16 @@ function suite.TreatAngleIncludeAsExternalOnFile() true ]] end + +function suite.TreatAngleIncludeAsExternalOffFile() + files { "hello1.cpp", "hello2.cpp" } + filter { "files:hello2.cpp" } + externalanglebrackets "Off" + prepareFiles() + test.capture [[ + + + + false + ]] +end diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index a6cca64a..b3cb82db 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -821,7 +821,7 @@ m.warningLevelFile, m.compileAsWinRT, m.externalWarningLevelFile, - m.externalAngleBracketsFile, + m.externalAngleBrackets, } else return { @@ -2872,18 +2872,7 @@ end - function m.externalAngleBrackets(cfg) - if _ACTION >= "vs2022" then - if cfg.externalanglebrackets == p.OFF then - m.element("TreatAngleIncludeAsExternal", nil, "false") - elseif cfg.externalanglebrackets == p.ON then - m.element("TreatAngleIncludeAsExternal", nil, "true") - end - end - end - - - function m.externalAngleBracketsFile(cfg, condition) + function m.externalAngleBrackets(cfg, condition) if _ACTION >= "vs2022" then if cfg.externalanglebrackets == p.OFF then m.element("TreatAngleIncludeAsExternal", condition, "false")