From a6ba5d9f69f2a2e32919418c01b235149e3102f0 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 25 Dec 2016 01:24:41 +0100 Subject: [PATCH] wscript: prepend defaults to honor user cflags --- wscript | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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'] -- 2.11.0