wscript :
authorMartin Hermant <martin.hermant@gmail.com>
Mon, 29 May 2017 14:50:08 +0000 (10:50 -0400)
committerMartin Hermant <martin.hermant@gmail.com>
Mon, 29 May 2017 14:50:08 +0000 (10:50 -0400)
use .min.js extension for release build
add assersions in debug build

wscript

diff --git a/wscript b/wscript
index 91d4ebe..acada7c 100644 (file)
--- a/wscript
+++ b/wscript
@@ -228,6 +228,14 @@ def configure(ctx):
     if target_platform == 'emscripten':
         import os.path
         ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
+        
+        if ctx.options.build_type == "debug":
+            ctx.env.cshlib_PATTERN = '%s.js'
+            ctx.env.LINKFLAGS_cshlib += ['-s','ASSERTIONS=1']
+        else:
+            ctx.env.LINKFLAGS += ['-Oz']
+            ctx.env.cshlib_PATTERN = '%s.min.js'
+        
         ctx.env.cprogram_PATTERN = "%s.js"
         if (ctx.options.enable_atlas != True):
             ctx.options.enable_atlas = False