diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-02-19 15:48:34 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-04-02 09:03:45 +0200 |
commit | 404f025284f594197562f4a2003fb18898faa885 (patch) | |
tree | af28642b49a3470e9727e86fa1f6b6edd483bf65 /buildtools | |
parent | 8cdd9f3a7f5e2576c0676eeef32b44484516e885 (diff) | |
download | samba-404f025284f594197562f4a2003fb18898faa885.tar.gz |
wafsamba: add an optional allow_warnings(default=True) to CURRENT_CFLAGS()
-Werror is now remembered in PICKY_CFLAGS and only added if
allow_warnings is False.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_autoconf.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 1357fd7af46..316aeda547c 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -685,7 +685,7 @@ int main(void) { conf.env['EXTRA_CFLAGS'].extend(TO_LIST("-Werror=format")) if Options.options.picky_developer: - conf.ADD_CFLAGS('-Werror', testflags=True) + conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror', testflags=True) if Options.options.fatal_errors: conf.ADD_CFLAGS('-Wfatal-errors', testflags=True) @@ -759,14 +759,17 @@ def ADD_EXTRA_INCLUDES(conf, includes): -def CURRENT_CFLAGS(bld, target, cflags, hide_symbols=False): +def CURRENT_CFLAGS(bld, target, cflags, allow_warnings=True, hide_symbols=False): '''work out the current flags. local flags are added first''' + ret = TO_LIST(cflags) if not 'EXTRA_CFLAGS' in bld.env: list = [] else: list = bld.env['EXTRA_CFLAGS']; - ret = TO_LIST(cflags) ret.extend(list) + if not allow_warnings and 'PICKY_CFLAGS' in bld.env: + list = bld.env['PICKY_CFLAGS']; + ret.extend(list) if hide_symbols and bld.env.HAVE_VISIBILITY_ATTR: ret.append('-fvisibility=hidden') return ret |