build: Use cc.get_supported_arguments() instead of open-coding

I added support to Meson for cc.get_supported_arguments() when I was
typing out the initial build because I didn't like the open-coding, then
completely forgot to update Weston when it got merged.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-09-22 14:22:30 +01:00 committed by Pekka Paalanen
parent 3240ccc69d
commit 022e79bf3e

View file

@ -60,8 +60,7 @@ config_h = configuration_data()
cc = meson.get_compiler('c')
global_args = []
global_args_maybe = [
global_args = cc.get_supported_arguments(
'-Wmissing-prototypes',
'-Wno-unused-parameter',
'-Wno-shift-negative-value', # required due to Pixman
@ -69,12 +68,7 @@ global_args_maybe = [
'-Wno-pedantic',
'-Wundef',
'-fvisibility=hidden',
]
foreach a : global_args_maybe
if cc.has_argument(a)
global_args += a
endif
endforeach
)
add_global_arguments(global_args, language: 'c')
if cc.has_header_symbol('sys/sysmacros.h', 'major')