aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorFabrice Fontaine <fontaine.fabrice@gmail.com>2021-08-08 19:00:35 +0200
committerKenny Levinsen <kl@kl.wtf>2021-09-02 20:00:03 +0200
commit15b0972bd3b8dbd1dae16ab3eb31a1026a63d17e (patch)
treeec39b5e01594418f5ebb06cbcef43ccea5470371 /meson.build
parent038c30f9b1f93fb7fc9514366db3f3aa61a3ca49 (diff)
meson.build: fix build with gcc < 7
Test if arguments (e.g. -Wimplicit-fallthrough) is available before using it as -Wimplicit-fallthrough has been added only since gcc 7.1 and https://github.com/gcc-mirror/gcc/commit/81fea426da8c4687bb32e6894dc26f00ae211822 and so it will raise the following build failure with gcc < 7: arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Wimplicit-fallthrough' Fixes: - http://autobuild.buildroot.org/results/0ee6816a7cceebdafd07612677a594bdf68e0790 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build5
1 files changed, 3 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 1131b4b..17324ec 100644
--- a/meson.build
+++ b/meson.build
@@ -22,7 +22,8 @@ if defaultpath == ''
endif
endif
-add_project_arguments(
+cc = meson.get_compiler('c')
+add_project_arguments(cc.get_supported_arguments(
[
'-Wundef',
'-Wunused',
@@ -41,7 +42,7 @@ add_project_arguments(
'-D__BSD_VISIBLE',
'-DSEATD_VERSION="@0@"'.format(meson.project_version()),
'-DSEATD_DEFAULTPATH="@0@"'.format(defaultpath)
- ],
+ ]),
language: 'c',
)