mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
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>
This commit is contained in:
parent
8cdd9f3a7f
commit
404f025284
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user