Build HTML5 release_debug with -Os, like release.

The increased build time is negligible in comparison to the decreased
file size.
This commit is contained in:
Leon Krause 2018-05-14 15:11:42 +02:00
parent 504ffda8d7
commit 975c0516a4

View file

@ -38,7 +38,7 @@ def configure(env):
## Build type ## Build type
if env['target'] == 'release' or env['target'] == 'profile': if env['target'] != 'debug':
# Use -Os to prioritize optimizing for reduced file size. This is # Use -Os to prioritize optimizing for reduced file size. This is
# particularly valuable for the web platform because it directly # particularly valuable for the web platform because it directly
# decreases download time. # decreases download time.
@ -47,15 +47,11 @@ def configure(env):
# run-time performance. # run-time performance.
env.Append(CCFLAGS=['-Os']) env.Append(CCFLAGS=['-Os'])
env.Append(LINKFLAGS=['-Os']) env.Append(LINKFLAGS=['-Os'])
if env['target'] == 'release_debug':
elif env['target'] == 'release_debug': env.Append(CPPDEFINES=['DEBUG_ENABLED'])
env.Append(CPPDEFINES=['DEBUG_ENABLED']) # Retain function names for backtraces at the cost of file size.
env.Append(CCFLAGS=['-O2']) env.Append(LINKFLAGS=['--profiling-funcs'])
env.Append(LINKFLAGS=['-O2']) else:
# Retain function names for backtraces at the cost of file size.
env.Append(LINKFLAGS=['--profiling-funcs'])
elif env['target'] == 'debug':
env.Append(CPPDEFINES=['DEBUG_ENABLED']) env.Append(CPPDEFINES=['DEBUG_ENABLED'])
env.Append(CCFLAGS=['-O1', '-g']) env.Append(CCFLAGS=['-O1', '-g'])
env.Append(LINKFLAGS=['-O1', '-g']) env.Append(LINKFLAGS=['-O1', '-g'])