wscript : use -Oz when building release with emscripten
authorMartin Hermant <martin.hermant@gmail.com>
Mon, 29 May 2017 14:44:29 +0000 (10:44 -0400)
committerMartin Hermant <martin.hermant@gmail.com>
Mon, 29 May 2017 14:44:29 +0000 (10:44 -0400)
wscript

diff --git a/wscript b/wscript
index 071d72f..e630327 100644 (file)
--- a/wscript
+++ b/wscript
@@ -141,6 +141,10 @@ def configure(ctx):
             # no optimization in debug mode
             ctx.env.prepend_value('CFLAGS', ['-O0'])
         else:
+            if target_platform == 'emscripten':
+                # -Oz for small js file generation
+                ctx.env.prepend_value('CFLAGS', ['-Oz'])
+            else:
             # default to -O2 in release mode
             ctx.env.prepend_value('CFLAGS', ['-O2'])
         # enable debug symbols and configure warnings