Skip to content

Commit

Permalink
Add options to build with rtti and exceptions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
csmartdalton and csmartdalton committed Oct 23, 2023
1 parent 9068d51 commit 562ace4
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
82d664d4b98fafae7d064cc8945db101580b7d41
d65b239c5c6ce44c3b58cd71ff17721d874a4ab1
2 changes: 0 additions & 2 deletions build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ do
flags {
'FatalCompileWarnings',
}
exceptionhandling 'off'
rtti 'off'

filter {'system:macosx'}
do
Expand Down
14 changes: 14 additions & 0 deletions build/setup_compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ end

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"
Expand Down
2 changes: 0 additions & 2 deletions cg_renderer/build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ do
flags {
'FatalCompileWarnings',
}
exceptionhandling 'off'
rtti 'off'

filter "system:windows"
do
Expand Down
2 changes: 0 additions & 2 deletions decoders/build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ project 'rive_decoders'
kind 'StaticLib'
language "C++"
cppdialect "C++17"
exceptionhandling "Off"
rtti "Off"
targetdir "%{cfg.buildcfg}"
objdir "obj/%{cfg.buildcfg}"
flags { "FatalWarnings" }
Expand Down
3 changes: 0 additions & 3 deletions dependencies/premake5_harfbuzz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ do
harfbuzz .. '/src/graph/gsubgpos-context.cc'
}

exceptionhandling 'off'
rtti 'off'

warnings 'Off'

defines {
Expand Down
4 changes: 0 additions & 4 deletions dependencies/premake5_libpng.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ do
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 {
'./',
Expand Down Expand Up @@ -57,8 +55,6 @@ do
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
Expand Down
1 change: 1 addition & 0 deletions dev/test/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ do
objdir 'build/obj/%{cfg.buildcfg}'
flags {'FatalWarnings'}
buildoptions {'-Wall', '-fno-exceptions', '-fno-rtti'}
exceptionhandling "On"

includedirs {
'./include',
Expand Down
2 changes: 0 additions & 2 deletions skia/renderer/build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ do
flags {
'FatalCompileWarnings',
}
exceptionhandling 'off'
rtti 'off'

filter "system:windows"
do
Expand Down

0 comments on commit 562ace4

Please sign in to comment.