Deprecate SEH flag; add value to exceptionhandling()

This commit is contained in:
Jason Perkins 2015-06-23 19:03:28 -04:00
parent 313a7c31ce
commit f59651f3f6
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",
@ -842,6 +832,17 @@
tokens = true,
}
api.register {
name = "rtti",
scope = "config",
kind = "string",
allowed = {
"Default",
"On",
"Off",
},
}
api.register {
name = "rules",
scope = "project",
@ -1162,6 +1163,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)
@ -1279,6 +1287,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

@ -1097,14 +1097,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))