From: Paul Brossier Date: Sun, 25 Dec 2016 00:24:41 +0000 (+0100) Subject: wscript: prepend defaults to honor user cflags X-Git-Tag: 0.4.4~18 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=a6ba5d9f69f2a2e32919418c01b235149e3102f0;p=aubio.git wscript: prepend defaults to honor user cflags --- diff --git a/wscript b/wscript index d8afc03b..86517d60 100644 --- a/wscript +++ b/wscript @@ -137,11 +137,14 @@ def configure(ctx): 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']