From 159281ea5af663a86388b6877d5c7c05ccace9ee Mon Sep 17 00:00:00 2001 From: Thomas Desveaux Date: Tue, 10 Apr 2018 21:38:31 +0200 Subject: [PATCH] Implement unsignedchar for vstudio --- .../tests/vc2010/test_compile_settings.lua | 29 +++++++++++++++++++ modules/vstudio/vs2010_vcxproj.lua | 6 ++++ 2 files changed, 35 insertions(+) diff --git a/modules/vstudio/tests/vc2010/test_compile_settings.lua b/modules/vstudio/tests/vc2010/test_compile_settings.lua index bbffd42c..86777f25 100644 --- a/modules/vstudio/tests/vc2010/test_compile_settings.lua +++ b/modules/vstudio/tests/vc2010/test_compile_settings.lua @@ -1238,3 +1238,32 @@ ]] end + +-- +-- Check UnsignedChar. +-- + + function suite.unsignedChar_On() + unsignedchar "On" + prepare() + test.capture [[ + + NotUsing + Level3 + Disabled + /J %(AdditionalOptions) + + ]] + end + + function suite.unsignedChar_Off() + unsignedchar "Off" + prepare() + test.capture [[ + + NotUsing + Level3 + Disabled + + ]] + end diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index 6909fac8..703e292f 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -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)