From 15b0972bd3b8dbd1dae16ab3eb31a1026a63d17e Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 8 Aug 2021 19:00:35 +0200 Subject: 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 --- meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'meson.build') 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', ) -- cgit v1.2.3