Merge pull request #1789 from LoneBoco/bugfix-externalwarning
Include the configuration condition for ExternalWarningLevel.
This commit is contained in:
commit
1b8ef89cae
@ -25,6 +25,11 @@ local function prepare(platform)
|
||||
vc2010.clCompile(cfg)
|
||||
end
|
||||
|
||||
local function prepareFiles(platform)
|
||||
prj = test.getproject(wks, 1)
|
||||
vc2010.files(prj)
|
||||
end
|
||||
|
||||
--
|
||||
-- Check ClCompile for ExternalWarningLevel
|
||||
--
|
||||
@ -88,6 +93,19 @@ function suite.ExternalWarningLevelEverything()
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.ExternalWarningLevelOnFile()
|
||||
files { "hello1.cpp", "hello2.cpp" }
|
||||
filter { "files:hello2.cpp" }
|
||||
externalwarnings "High"
|
||||
prepareFiles()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="hello1.cpp" />
|
||||
<ClCompile Include="hello2.cpp">
|
||||
<ExternalWarningLevel>Level4</ExternalWarningLevel>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Check ClCompile for TreatAngleIncludeAsExternal
|
||||
--
|
||||
@ -116,3 +134,29 @@ function suite.TreatAngleIncludeAsExternalOff()
|
||||
<TreatAngleIncludeAsExternal>false</TreatAngleIncludeAsExternal>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.TreatAngleIncludeAsExternalOnFile()
|
||||
files { "hello1.cpp", "hello2.cpp" }
|
||||
filter { "files:hello2.cpp" }
|
||||
externalanglebrackets "On"
|
||||
prepareFiles()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<ClCompile Include="hello1.cpp" />
|
||||
<ClCompile Include="hello2.cpp">
|
||||
<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
|
||||
|
@ -821,7 +821,7 @@
|
||||
m.runtimeTypeInfo,
|
||||
m.warningLevelFile,
|
||||
m.compileAsWinRT,
|
||||
m.externalWarningLevel,
|
||||
m.externalWarningLevelFile,
|
||||
m.externalAngleBrackets,
|
||||
}
|
||||
else
|
||||
@ -2867,7 +2867,17 @@
|
||||
end
|
||||
|
||||
|
||||
function m.externalAngleBrackets(cfg)
|
||||
function m.externalWarningLevelFile(cfg, condition)
|
||||
if _ACTION >= "vs2022" then
|
||||
if cfg.externalwarnings then
|
||||
local map = { Off = "TurnOffAllWarnings", High = "Level4", Extra = "Level4", Everything = "Level4" }
|
||||
m.element("ExternalWarningLevel", condition, map[cfg.externalwarnings] or "Level3")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function m.externalAngleBrackets(cfg, condition)
|
||||
if _ACTION >= "vs2022" then
|
||||
if cfg.externalanglebrackets == p.OFF then
|
||||
m.element("TreatAngleIncludeAsExternal", condition, "false")
|
||||
|
Reference in New Issue
Block a user