Implement unsignedchar for vstudio

This commit is contained in:
Thomas Desveaux 2018-04-10 21:38:31 +02:00
parent d556b6510f
commit 159281ea5a
2 changed files with 35 additions and 0 deletions

View File

@ -1238,3 +1238,32 @@
</ClCompile>
]]
end
--
-- Check UnsignedChar.
--
function suite.unsignedChar_On()
unsignedchar "On"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalOptions>/J %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
]]
end
function suite.unsignedChar_Off()
unsignedchar "Off"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
]]
end

View File

@ -1355,6 +1355,12 @@
table.insert(opts, "/std:c++latest")
end
end
if cfg.toolset and cfg.toolset:startswith("msc") then
local value = iif(cfg.unsignedchar, "On", "Off")
table.insert(opts, p.tools.msc.shared.unsignedchar[value])
end
if #opts > 0 then
opts = table.concat(opts, " ")
m.element("AdditionalOptions", condition, '%s %%(AdditionalOptions)', opts)