Skip to content

Commit

Permalink
build: ensure compiler flags are properly detected
Browse files Browse the repository at this point in the history
While checking for compiler flag availability, treat warnings
as errors. Thus if the compiler only warns about unsupported flag,
it will fail the test and the flag shall be marked as unsupported.

Signed-off-by: Uri Simchoni <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>

Autobuild-User(master): Andrew Bartlett <[email protected]>
Autobuild-Date(master): Wed Nov 22 14:19:20 CET 2017 on sn-devel-144
  • Loading branch information
urisimchoni authored and abartlet committed Nov 22, 2017
1 parent 2e53d6a commit 667335a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buildtools/wafsamba/samba_autoconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,13 @@ def CHECK_STRUCTURE_MEMBER(conf, structname, member,
def CHECK_CFLAGS(conf, cflags, fragment='int main(void) { return 0; }\n'):
'''check if the given cflags are accepted by the compiler
'''
check_cflags = TO_LIST(cflags)
if 'WERROR_CFLAGS' in conf.env:
check_cflags.extend(conf.env['WERROR_CFLAGS'])
return conf.check(fragment=fragment,
execute=0,
type='nolink',
ccflags=cflags,
ccflags=check_cflags,
msg="Checking compiler accepts %s" % cflags)

@conf
Expand Down

0 comments on commit 667335a

Please sign in to comment.