Merge pull request #15447 from eska014/html5-optmode
Build WebAssembly release module with -Os to decrease file size
This commit is contained in:
commit
4ab4001ab2
1 changed files with 8 additions and 2 deletions
|
@ -49,8 +49,14 @@ def configure(env):
|
||||||
## Build type
|
## Build type
|
||||||
|
|
||||||
if (env["target"] == "release"):
|
if (env["target"] == "release"):
|
||||||
env.Append(CCFLAGS=['-O3'])
|
# Use -Os to prioritize optimizing for reduced file size. This is
|
||||||
env.Append(LINKFLAGS=['-O3'])
|
# particularly valuable for the web platform because it directly
|
||||||
|
# decreases download time.
|
||||||
|
# -Os reduces file size by around 5 MiB over -O3. -Oz only saves about
|
||||||
|
# 100 KiB over -Os, which does not justify the negative impact on
|
||||||
|
# run-time performance.
|
||||||
|
env.Append(CCFLAGS=['-Os'])
|
||||||
|
env.Append(LINKFLAGS=['-Os'])
|
||||||
|
|
||||||
elif (env["target"] == "release_debug"):
|
elif (env["target"] == "release_debug"):
|
||||||
env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
|
env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
|
||||||
|
|
Loading…
Reference in a new issue