diff --git a/src/_premake_init.lua b/src/_premake_init.lua index 84ca8ddc..4d09b119 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -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 diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index 3e002b1f..5cce45ed 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -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 diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index f45cddae..a1816ef8 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -1097,14 +1097,11 @@ function m.exceptionHandling(cfg) + local value if cfg.exceptionhandling == p.OFF then p.w('false') - elseif cfg.exceptionhandling == p.ON or cfg.flags.SEH then - if cfg.flags.SEH then - p.w('Async') - else - p.w('Sync') - end + elseif cfg.exceptionhandling == "SEH" then + p.w('Async') end end diff --git a/src/tools/msc.lua b/src/tools/msc.lua index 5226d125..20270661 100644 --- a/src/tools/msc.lua +++ b/src/tools/msc.lua @@ -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 diff --git a/tests/actions/vstudio/vc2010/test_compile_settings.lua b/tests/actions/vstudio/vc2010/test_compile_settings.lua index 65023cea..eb822540 100644 --- a/tests/actions/vstudio/vc2010/test_compile_settings.lua +++ b/tests/actions/vstudio/vc2010/test_compile_settings.lua @@ -509,7 +509,7 @@ end function suite.exceptions_onSEH() - flags "SEH" + exceptionhandling "SEH" prepare() test.capture [[ diff --git a/tests/tools/test_msc.lua b/tests/tools/test_msc.lua index b05e56ce..37c8f26d 100644 --- a/tests/tools/test_msc.lua +++ b/tests/tools/test_msc.lua @@ -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))