diff --git a/meson.build b/meson.build index 5a552ef70..82cd7c62a 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')