[Web] Use Oz instead of Os when optimizing for size
LLVM has an Oz optimization flag, which they define as: `Like -Os (and thus -O2), but reduces code size further.` I've tested this, on a release builds, and the result is ~25% smaller uncompressed size, and ~10% smaller when compressed.
This commit is contained in:
parent
c3e16cda00
commit
59d4a52fe4
|
@ -770,8 +770,12 @@ else:
|
|||
env.Append(CCFLAGS=["-O2"])
|
||||
env.Append(LINKFLAGS=["-O2"])
|
||||
elif env["optimize"] == "size":
|
||||
env.Append(CCFLAGS=["-Os"])
|
||||
env.Append(LINKFLAGS=["-Os"])
|
||||
if methods.using_emcc(env):
|
||||
env.Append(CCFLAGS=["-Oz"])
|
||||
env.Append(LINKFLAGS=["-Oz"])
|
||||
else:
|
||||
env.Append(CCFLAGS=["-Os"])
|
||||
env.Append(LINKFLAGS=["-Os"])
|
||||
elif env["optimize"] == "debug":
|
||||
env.Append(CCFLAGS=["-Og"])
|
||||
env.Append(LINKFLAGS=["-Og"])
|
||||
|
|
Loading…
Reference in New Issue