Deprecate SEH flag; add value to exceptionhandling()

This commit is contained in:
Jason Perkins 2015-06-23 19:03:28 -04:00 committed by Damien Courtois
parent 2a608f4ca4
commit 9f68132f53
6 changed files with 37 additions and 31 deletions

View File

@ -359,17 +359,7 @@
"Default",
"On",
"Off",
},
}
api.register {
name = "rtti",
scope = "config",
kind = "string",
allowed = {
"Default",
"On",
"Off",
"SEH"
},
}
@ -462,7 +452,7 @@
"OptimizeSpeed", -- DEPRECATED
"RelativeLinks",
"ReleaseRuntime", -- DEPRECATED
"SEH",
"SEH", -- DEPRECATED
"ShadowedVariables",
"StaticRuntime",
"Symbols",
@ -854,6 +844,17 @@
tokens = true,
}
api.register {
name = "rtti",
scope = "config",
kind = "string",
allowed = {
"Default",
"On",
"Off",
},
}
api.register {
name = "rules",
scope = "project",
@ -1174,6 +1175,13 @@
rtti "On"
end)
api.deprecateValue("flags", "SEH", 'Use `exceptionhandling "SEH"` instead',
function(value)
exceptionhandling "SEH"
end,
function(value)
exceptionhandling "Default"
end)
api.deprecateValue("flags", "Unsafe", nil,
function(value)
@ -1291,6 +1299,8 @@
-----------------------------------------------------------------------------
clr "Off"
exceptionhandling "Default"
rtti "Default"
-- Setting a default language makes some validation easier later

View File

@ -1124,7 +1124,7 @@
function m.exceptionHandling(cfg)
if cfg.exceptionhandling == p.OFF then
p.w('ExceptionHandling="%s"', iif(_ACTION < "vs2005", "FALSE", 0))
elseif cfg.flags.SEH and _ACTION > "vs2003" then
elseif cfg.exceptionhandling == "SEH" and _ACTION > "vs2003" then
p.w('ExceptionHandling="2"')
end
end

View File

@ -1098,14 +1098,11 @@
function m.exceptionHandling(cfg)
local value
if cfg.exceptionhandling == p.OFF then
p.w('<ExceptionHandling>false</ExceptionHandling>')
elseif cfg.exceptionhandling == p.ON or cfg.flags.SEH then
if cfg.flags.SEH then
p.w('<ExceptionHandling>Async</ExceptionHandling>')
else
p.w('<ExceptionHandling>Sync</ExceptionHandling>')
end
elseif cfg.exceptionhandling == "SEH" then
p.w('<ExceptionHandling>Async</ExceptionHandling>')
end
end

View File

@ -40,7 +40,6 @@
MultiProcessorCompile = "/MP",
NoFramePointer = "/Oy",
NoMinimalRebuild = "/Gm-",
SEH = "/EHa",
Symbols = "/Z7",
OmitDefaultLibrary = "/Zl",
},
@ -106,6 +105,11 @@
--
msc.cxxflags = {
exceptionhandling = {
Default = "/EHsc",
On = "/EHsc",
SEH = "/EHa",
},
rtti = {
Off = "/GR-"
}
@ -113,11 +117,6 @@
function msc.getcxxflags(cfg)
local flags = config.mapFlags(cfg, msc.cxxflags)
if not cfg.flags.SEH and cfg.exceptionhandling ~= p.OFF then
table.insert(flags, "/EHsc")
end
return flags
end

View File

@ -509,7 +509,7 @@
end
function suite.exceptions_onSEH()
flags "SEH"
exceptionhandling "SEH"
prepare()
test.capture [[
<ClCompile>

View File

@ -227,25 +227,25 @@
-- Check handling of C++ language features.
--
function suite.cflags_onExceptions()
function suite.cxxflags_onExceptions()
exceptionhandling "on"
prepare()
test.contains("/EHsc", msc.getcxxflags(cfg))
end
function suite.cflags_onSEH()
flags "SEH"
function suite.cxxflags_onSEH()
exceptionhandling "SEH"
prepare()
test.contains("/EHa", msc.getcxxflags(cfg))
end
function suite.cflags_onNoExceptions()
function suite.cxxflags_onNoExceptions()
exceptionhandling "Off"
prepare()
test.missing("/EHsc", msc.getcxxflags(cfg))
end
function suite.cflags_onNoRTTI()
function suite.cxxflags_onNoRTTI()
rtti "Off"
prepare()
test.contains("/GR-", msc.getcxxflags(cfg))