Fix mapping of exception handler and rtti values in tool adapters

This commit is contained in:
Jason Perkins 2015-06-23 16:52:17 -04:00
parent 41dec88056
commit d35a5f5ebf
2 changed files with 21 additions and 21 deletions

View File

@ -106,21 +106,21 @@
--
gcc.cxxflags = {
exceptionhandling = {
Off = "-fno-exceptions"
},
flags = {
NoBufferSecurityCheck = "-fno-stack-protector",
["C++11"] = "-std=c++11",
["C++14"] = "-std=c++14",
},
rtti = {
Off = "-fno-rtti"
}
}
function gcc.getcxxflags(cfg)
local flags = config.mapFlags(cfg, gcc.cxxflags)
if cfg.exceptionhandling == p.OFF then
table.insert(flags, '-fno-exceptions')
end
if cfg.rtti == p.OFF then
table.insert(flags, '-fno-rtti')
end
return flags
end

View File

@ -7,10 +7,12 @@
---
premake.tools.msc = {}
local msc = premake.tools.msc
local project = premake.project
local config = premake.config
local p = premake
p.tools.msc = {}
local msc = p.tools.msc
local project = p.project
local config = p.config
--
@ -103,19 +105,17 @@
-- Returns list of C++ compiler flags for a configuration.
--
msc.cxxflags = {
rtti = {
Off = "/GR-"
}
}
function msc.getcxxflags(cfg)
local flags = {}
local flags = config.mapFlags(cfg, msc.cxxflags)
if cfg.rtti == premake.OFF then
table.insert(flags, "/GR-")
end
if cfg.exceptionhandling == premake.ON or cfg.flags.SEH then
if cfg.flags.SEH then
table.insert(flags, "/EHa")
else
table.insert(flags, "/EHsc")
end
if not cfg.flags.SEH and cfg.exceptionhandling ~= p.OFF then
table.insert(flags, "/EHsc")
end
return flags