From 022e79bf3eb163cf649cddcab29a345787df3e00 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 22 Sep 2022 14:22:30 +0100 Subject: [PATCH] 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 --- meson.build | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 5a552ef7..82cd7c62 100644 --- a/meson.build +++ b/meson.build @@ -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')