meson: add option to disable selective werror

Submitted by Marty E. Plummer on Aug. 9, 2018, 5:37 p.m.

Details

Message ID 20180809173702.11894-1-hanetzer@startmail.com
State New
Series "meson: add option to disable selective werror"
Headers show

Commit Message

Marty E. Plummer Aug. 9, 2018, 5:37 p.m.
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
---
 meson.build       | 12 +++++++-----
 meson_options.txt |  2 ++
 2 files changed, 9 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meson.build b/meson.build
index cd1e4a58c..b2c46f730 100644
--- a/meson.build
+++ b/meson.build
@@ -50,11 +50,13 @@  else
 endif
 
 common_wflags = []
-foreach wflag: test_wflags
-    if cc.has_argument(wflag)
-        common_wflags += [ wflag ]
-    endif
-endforeach
+if get_option('selective-werror')
+  foreach wflag: test_wflags
+      if cc.has_argument(wflag)
+          common_wflags += [ wflag ]
+      endif
+  endforeach
+endif
 
 add_global_arguments(common_wflags, language : 'c')
 
diff --git a/meson_options.txt b/meson_options.txt
index 3453b8df5..c7f299a4a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -16,6 +16,8 @@  option('xvfb', type: 'boolean', value: true,
        description: 'Enable Xvfb X server')
 option('xwin', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
        description: 'Enable XWin X server')
+option('selective-werror', type: 'boolean', value true,
+       description: 'Enable selective werror')
 
 option('builder_addr', type: 'string', description: 'Builder address', value: 'xorg@lists.freedesktop.org')
 option('builder_string', type: 'string', description: 'Additional builder string')