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
81fea426da
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>
This commit is contained in:
parent
038c30f9b1
commit
15b0972bd3
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,8 @@ if defaultpath == ''
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_project_arguments(
|
cc = meson.get_compiler('c')
|
||||||
|
add_project_arguments(cc.get_supported_arguments(
|
||||||
[
|
[
|
||||||
'-Wundef',
|
'-Wundef',
|
||||||
'-Wunused',
|
'-Wunused',
|
||||||
|
@ -41,7 +42,7 @@ add_project_arguments(
|
||||||
'-D__BSD_VISIBLE',
|
'-D__BSD_VISIBLE',
|
||||||
'-DSEATD_VERSION="@0@"'.format(meson.project_version()),
|
'-DSEATD_VERSION="@0@"'.format(meson.project_version()),
|
||||||
'-DSEATD_DEFAULTPATH="@0@"'.format(defaultpath)
|
'-DSEATD_DEFAULTPATH="@0@"'.format(defaultpath)
|
||||||
],
|
]),
|
||||||
language: 'c',
|
language: 'c',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue