Reduced redundant code and added another test case.

This commit is contained in:
John Norman 2022-01-06 01:40:44 -08:00
parent 88649340e5
commit 9fe297f5bb
2 changed files with 15 additions and 13 deletions

View File

@ -147,3 +147,16 @@ function suite.TreatAngleIncludeAsExternalOnFile()
<TreatAngleIncludeAsExternal>true</TreatAngleIncludeAsExternal>
]]
end
function suite.TreatAngleIncludeAsExternalOffFile()
files { "hello1.cpp", "hello2.cpp" }
filter { "files:hello2.cpp" }
externalanglebrackets "Off"
prepareFiles()
test.capture [[
<ItemGroup>
<ClCompile Include="hello1.cpp" />
<ClCompile Include="hello2.cpp">
<TreatAngleIncludeAsExternal>false</TreatAngleIncludeAsExternal>
]]
end

View File

@ -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")