mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
Use -fno-exceptions for more performance; disable RTTI in release builds
This commit is contained in:
parent
368e1ca644
commit
8098460433
@ -1108,8 +1108,6 @@ def CompileCxx(obj,src,opts):
|
||||
cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
|
||||
cmd += ' -frerun-cse-after-loop -frename-registers'
|
||||
|
||||
if not src.endswith(".c"):
|
||||
cmd += " -fno-exceptions -fno-rtti"
|
||||
cmd += " -Wa,--noexecstack"
|
||||
|
||||
# Now add specific release/debug flags.
|
||||
@ -1135,6 +1133,16 @@ def CompileCxx(obj,src,opts):
|
||||
else:
|
||||
cmd += " -pthread"
|
||||
|
||||
if not src.endswith(".c"):
|
||||
# We don't use exceptions.
|
||||
if 'EXCEPTIONS' not in opts:
|
||||
cmd += " -fno-exceptions"
|
||||
|
||||
if 'RTTI' not in opts:
|
||||
# We always disable RTTI on Android for memory usage reasons.
|
||||
if optlevel >= 4 or GetTarget() == "android":
|
||||
cmd += " -fno-rtti"
|
||||
|
||||
if PkgSkip("SSE2") == 0 and not arch.startswith("arm"):
|
||||
cmd += " -msse2"
|
||||
|
||||
@ -2185,6 +2193,10 @@ def WriteConfigSettings():
|
||||
if (GetOptimize() >= 4):
|
||||
dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
|
||||
|
||||
if (GetOptimize() >= 4):
|
||||
# Disable RTTI on release builds.
|
||||
dtool_config["HAVE_RTTI"] = 'UNDEF'
|
||||
|
||||
# Now that we have OS_SIMPLE_THREADS, we can support
|
||||
# SIMPLE_THREADS on exotic architectures like win64, so we no
|
||||
# longer need to disable it for this platform.
|
||||
@ -3665,7 +3677,7 @@ if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
|
||||
TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
|
||||
TargetAdd('libp3rocket.dll', opts=OPTS)
|
||||
|
||||
OPTS=['DIR:panda/src/rocket', 'ROCKET']
|
||||
OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS']
|
||||
IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
|
||||
"rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
|
||||
TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
|
||||
|
Loading…
x
Reference in New Issue
Block a user