summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-13 00:38:00 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-13 14:10:48 +0200
commit461e7ac873cf0def6b3dd6c7905f3c5b65734280 (patch)
tree028cf8a1ae408399e077525033d8bd1e7cfc8376
parentda3f50ee9cdb6896b365357b0d35577344f72ba4 (diff)
meson.build: Silence the C99 designators warning
We use array designators for array initialization, which is a C99 extension. clang-10 warns about it, causing a build failure. As this is a useful extension, silence the warning. This needs to be done only if the compiler supports the -Wno-c99-designator argument, otherwise a -Wunknown-warning-option will be generated. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--meson.build9
1 files changed, 9 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 0bbd24b2..c6e6a934 100644
--- a/meson.build
+++ b/meson.build
@@ -60,6 +60,15 @@ if cc.get_id() == 'clang'
endif
endif
+# We use C99 designated initializers for arrays as C++ has no equivalent
+# feature. Both gcc and clang support this extension, but recent
+# versions of clang generate a warning that needs to be disabled.
+if cc.has_argument('-Wno-c99-designator')
+ common_arguments += [
+ '-Wno-c99-designator',
+ ]
+endif
+
c_arguments += common_arguments
cpp_arguments += common_arguments