wafsamba: add -Wcast-qual only to the toplevel (s4) build.
[samba.git] / buildtools / wafsamba / samba_autoconf.py
index 02b52df4b06f99d031e1ec1accb947d1e83c12f2..174ca142102a038bfab7751dcf48ce469229fa58 100644 (file)
@@ -597,8 +597,10 @@ def SAMBA_CONFIG_H(conf, path=None):
 
     if Options.options.developer:
         # we add these here to ensure that -Wstrict-prototypes is not set during configure
-        conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes',
+        conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes',
                         testflags=True)
+        if os.getenv('TOPLEVEL_BUILD'):
+            conf.ADD_CFLAGS('-Wcast-qual', testflags=True)
         conf.env.DEVELOPER_MODE = True
 
     if Options.options.picky_developer: