aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-01-19 10:43:04 -0800
committerDylan Baker <dylan@pnwbakers.com>2022-01-20 10:07:55 -0800
commiteaf234c1489f53035fba1698c1a27781f5755be6 (patch)
tree8a5fab3aa4b1513074919f70fa10cd6e791f28f1
parent6b0b493555af7ef9374d6b2e7feafd848090d6e7 (diff)
downloadlibdrm-eaf234c1489f53035fba1698c1a27781f5755be6.tar.gz
meson: switch to cc.get_supported_arguments
This is generally faster, as meson is able to parallelize the checks for us. This also removes the workaround for checking gcc/clang -Wno-* arguments, which meson now handles internally so we don't need to handle it ourselves. Signed-off-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Simon Ser <contact@emersion.fr>
-rw-r--r--meson.build35
1 files changed, 10 insertions, 25 deletions
diff --git a/meson.build b/meson.build
index f0211457..646800ef 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,7 @@ project(
['c'],
version : '2.4.109',
license : 'MIT',
- meson_version : '>= 0.46',
+ meson_version : '>= 0.48',
default_options : ['buildtype=debugoptimized', 'c_std=c99'],
)
@@ -219,30 +219,15 @@ if (cc.has_header_symbol('sys/mkdev.h', 'major') and
endif
config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
-warn_c_args = []
-foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef',
- '-Werror=implicit-function-declaration', '-Wpointer-arith',
- '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes',
- '-Wmissing-declarations', '-Wnested-externs', '-Wpacked',
- '-Wswitch-enum', '-Wmissing-format-attribute',
- '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
- '-Wdeclaration-after-statement', '-Wold-style-definition']
- if cc.has_argument(a)
- warn_c_args += a
- endif
-endforeach
-# GCC will never error for -Wno-*, so check for -W* then add -Wno-* to the list
-# of options
-foreach a : ['unused-parameter', 'attributes', 'long-long',
- 'missing-field-initializers']
- if cc.has_argument('-W@0@'.format(a))
- warn_c_args += '-Wno-@0@'.format(a)
- endif
-endforeach
-
-# all c args:
-
-libdrm_c_args = warn_c_args
+libdrm_c_args = cc.get_supported_arguments([
+ '-Wsign-compare', '-Werror=undef', '-Werror=implicit-function-declaration',
+ '-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes',
+ '-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs',
+ '-Wpacked', '-Wswitch-enum', '-Wmissing-format-attribute',
+ '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
+ '-Wdeclaration-after-statement', '-Wold-style-definition',
+ '-Wno-unused-parameter', '-Wno-attributes', '-Wno-long-long',
+ '-Wno-missing-field-initializers'])
dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : with_intel)
dep_cunit = dependency('cunit', version : '>= 2.1', required : false)