From d384ce5b5c5d3d15d328e469a17bd87969e88a52 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 19 Feb 2023 02:37:56 +0200 Subject: [PATCH 37/37] Meson: Never set -Wno-c99-extensions if compiler does not support it See osdn #47400 Signed-off-by: Marko Lindqvist --- meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index bac8da1423..3fa6e26add 100644 --- a/meson.build +++ b/meson.build @@ -176,8 +176,14 @@ if host_system == 'windows' get_option('clients').contains('qt') or \ get_option('fcmp').contains('qt') if get_option('debug') - # Qt headers have malformed macro definition triggering this error - add_global_arguments('-Wno-c99-extensions', language : ['c', 'cpp']) + # Qt flags have malformed macro definition triggering this error + # Also C compiler affected as the macro is on its commandline too + if c_compiler.has_argument('-Wno-c99-extensions') + add_global_arguments('-Wno-c99-extensions', language : 'c') + endif + if cxx_compiler.has_argument('-Wno-c99-extensions') + add_global_arguments('-Wno-c99-extensions', language : 'cpp') + endif endif if min_win_ver == '' if get_option('qtver') == 'qt6' -- 2.39.1