shithub: aubio

Download patch

ref: a6ba5d9f69f2a2e32919418c01b235149e3102f0
parent: c04346de33fb326aa6ea3abb9f3b07218b12cf7d
author: Paul Brossier <[email protected]>
date: Sat Dec 24 20:24:41 EST 2016

wscript: prepend defaults to honor user cflags

--- a/wscript
+++ b/wscript
@@ -137,11 +137,14 @@
         ctx.define('NDEBUG', 1)
 
     if ctx.env.CC_NAME != 'msvc':
-        # enable debug symbols and configure warnings
-        ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
         if ctx.options.build_type == "debug":
             # no optimization in debug mode
-            ctx.env.CFLAGS += ['-O0']
+            ctx.env.prepend_value('CFLAGS', ['-O0'])
+        else:
+            # default to -O2 in release mode
+            ctx.env.prepend_value('CFLAGS', ['-O2'])
+        # enable debug symbols and configure warnings
+        ctx.env.prepend_value('CFLAGS', ['-g', '-Wall', '-Wextra'])
     else:
         # enable debug symbols
         ctx.env.CFLAGS += ['/Z7', '/FS']