Add options to build with rtti and exceptions Some systems we want to integrate with expect these features. Diffs= d65b239c5 Add options to build with rtti and exceptions (#6121) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head index 959c398..a0b41a4 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -82d664d4b98fafae7d064cc8945db101580b7d41 +d65b239c5c6ce44c3b58cd71ff17721d874a4ab1
diff --git a/build/premake5.lua b/build/premake5.lua index 42e5084..bfedda2 100644 --- a/build/premake5.lua +++ b/build/premake5.lua
@@ -34,8 +34,6 @@ flags { 'FatalCompileWarnings', } - exceptionhandling 'off' - rtti 'off' filter {'system:macosx'} do
diff --git a/build/setup_compiler.lua b/build/setup_compiler.lua index 4947ba3..860f964 100644 --- a/build/setup_compiler.lua +++ b/build/setup_compiler.lua
@@ -140,6 +140,20 @@ filter{} +newoption { + trigger = "with-rtti", + description = "don't disable rtti (nonstandard for Rive)", +} +newoption { + trigger = "with-exceptions", + description = "don't disable exceptions (nonstandard for Rive)", +} +filter {"options:not with-rtti"} rtti "Off" +filter {"options:with-rtti"} rtti "On" +filter {"options:not with-exceptions"} exceptionhandling "Off" +filter {"options:with-exceptions"} exceptionhandling "On" +filter{} + -- Don't use filter() here because we don't want to generate the "ndk-redirect-*" files if not -- building for android. if _OPTIONS["os"] == "android"
diff --git a/cg_renderer/build/premake5.lua b/cg_renderer/build/premake5.lua index e304207..5524bf9 100644 --- a/cg_renderer/build/premake5.lua +++ b/cg_renderer/build/premake5.lua
@@ -26,8 +26,6 @@ flags { 'FatalCompileWarnings', } - exceptionhandling 'off' - rtti 'off' filter "system:windows" do
diff --git a/decoders/build/premake5.lua b/decoders/build/premake5.lua index 5c139d0..44c5f66 100644 --- a/decoders/build/premake5.lua +++ b/decoders/build/premake5.lua
@@ -12,8 +12,6 @@ kind 'StaticLib' language "C++" cppdialect "C++17" - exceptionhandling "Off" - rtti "Off" targetdir "%{cfg.buildcfg}" objdir "obj/%{cfg.buildcfg}" flags { "FatalWarnings" }
diff --git a/dependencies/premake5_harfbuzz.lua b/dependencies/premake5_harfbuzz.lua index 2dcb71c..be3354f 100644 --- a/dependencies/premake5_harfbuzz.lua +++ b/dependencies/premake5_harfbuzz.lua
@@ -223,9 +223,6 @@ harfbuzz .. '/src/graph/gsubgpos-context.cc' } - exceptionhandling 'off' - rtti 'off' - warnings 'Off' defines {
diff --git a/dependencies/premake5_libpng.lua b/dependencies/premake5_libpng.lua index 77f8d2c..818d868 100644 --- a/dependencies/premake5_libpng.lua +++ b/dependencies/premake5_libpng.lua
@@ -10,8 +10,6 @@ cppdialect 'C++17' targetdir '%{cfg.system}/cache/bin/%{cfg.buildcfg}/' objdir '%{cfg.system}/cache/obj/%{cfg.buildcfg}/' - rtti "Off" - exceptionhandling "Off" os.copyfile(libpng .. '/scripts/pnglibconf.h.prebuilt', libpng .. '/pnglibconf.h') includedirs { './', @@ -57,8 +55,6 @@ cppdialect 'C++17' targetdir '%{cfg.system}/cache/bin/%{cfg.buildcfg}/' objdir '%{cfg.system}/cache/obj/%{cfg.buildcfg}/' - rtti "Off" - exceptionhandling "Off" defines {'ZLIB_IMPLEMENTATION'} includedirs { zlib
diff --git a/dev/test/premake5.lua b/dev/test/premake5.lua index 94d5ba8..030865e 100644 --- a/dev/test/premake5.lua +++ b/dev/test/premake5.lua
@@ -28,6 +28,7 @@ objdir 'build/obj/%{cfg.buildcfg}' flags {'FatalWarnings'} buildoptions {'-Wall', '-fno-exceptions', '-fno-rtti'} + exceptionhandling "On" includedirs { './include',
diff --git a/skia/renderer/build/premake5.lua b/skia/renderer/build/premake5.lua index e9bdc30..7c1826f 100644 --- a/skia/renderer/build/premake5.lua +++ b/skia/renderer/build/premake5.lua
@@ -37,8 +37,6 @@ flags { 'FatalCompileWarnings', } - exceptionhandling 'off' - rtti 'off' filter "system:windows" do