waf: use the correct WERROR_CFLAGS in CHECK_CODE
authorBjörn Jacke <bj@sernet.de>
Sun, 10 Feb 2019 00:29:22 +0000 (01:29 +0100)
committerBjoern Jacke <bjacke@samba.org>
Sun, 17 Feb 2019 12:33:15 +0000 (13:33 +0100)
all the non gcc version were incorrectly set here till now

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
buildtools/wafsamba/samba_autoconf.py

index 9d45ada13121ff8bce33a5da50aff7691a257c1e..7d975393c5b0cbb4d17810d92d35010c4ea587b8 100644 (file)
@@ -397,13 +397,8 @@ def CHECK_CODE(conf, code, define,
     # Be strict when relying on a compiler check
     # Some compilers (e.g. xlc) ignore non-supported features as warnings
     if strict:
-        extra_cflags = None
-        if conf.env["CC_NAME"] == "gcc":
-            extra_cflags = "-Werror"
-        elif conf.env["CC_NAME"] == "xlc":
-            extra_cflags = "-qhalt=w"
-        if extra_cflags:
-            cflags.append(extra_cflags)
+        if 'WERROR_CFLAGS' in conf.env:
+            cflags.extend(conf.env['WERROR_CFLAGS'])
 
     if local_include:
         cflags.append('-I%s' % conf.path.abspath())