1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Merge pull request #29032 from akien-mga/tools-exceptions-rtti

SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools build
This commit is contained in:
Rémi Verschelde
2019-05-21 17:10:51 +02:00
committed by GitHub
3 changed files with 15 additions and 10 deletions

View File

@@ -214,13 +214,14 @@ def configure(env):
lib_sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + env['ndk_platform'] + "/" + env['ARCH'] lib_sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + env['ndk_platform'] + "/" + env['ARCH']
## Compile flags ## Compile flags
# Disable exceptions and rtti on non-tools (template) builds
if env['android_stl']: if env['tools'] or env['android_stl']:
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/include"]) env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++/include"])
env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++abi/include"]) env.Append(CPPFLAGS=["-isystem", env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/llvm-libc++abi/include"])
env.Append(CXXFLAGS=['-frtti', "-std=gnu++14"]) env.Append(CXXFLAGS=['-frtti', "-std=gnu++14"])
else: else:
env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions']) env.Append(CXXFLAGS=['-fno-rtti', '-fno-exceptions'])
# Don't use dynamic_cast, necessary with no-rtti.
env.Append(CPPFLAGS=['-DNO_SAFE_CAST']) env.Append(CPPFLAGS=['-DNO_SAFE_CAST'])
ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"]) ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"])

View File

@@ -115,6 +115,8 @@ def configure(env):
env.Append(CPPFLAGS=['-DNEED_LONG_INT']) env.Append(CPPFLAGS=['-DNEED_LONG_INT'])
env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON']) env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON'])
# Disable exceptions on non-tools (template) builds
if not env['tools']:
if env['ios_exceptions']: if env['ios_exceptions']:
env.Append(CCFLAGS=['-fexceptions']) env.Append(CCFLAGS=['-fexceptions'])
else: else:

View File

@@ -110,6 +110,8 @@ def configure(env):
# once feasible also consider memory buffer size issues. # once feasible also consider memory buffer size issues.
env.Append(CPPDEFINES=['NO_THREADS']) env.Append(CPPDEFINES=['NO_THREADS'])
# Disable exceptions and rtti on non-tools (template) builds
if not env['tools']:
# These flags help keep the file size down. # These flags help keep the file size down.
env.Append(CCFLAGS=['-fno-exceptions', '-fno-rtti']) env.Append(CCFLAGS=['-fno-exceptions', '-fno-rtti'])
# Don't use dynamic_cast, necessary with no-rtti. # Don't use dynamic_cast, necessary with no-rtti.