[aisleriot] build: Fix format warnings test



commit 9dd4280acf4ab5d1079542aabaddfb4513cf555d
Author: Christian Persch <chpe src gnome org>
Date:   Fri Sep 20 21:10:19 2019 +0200

    build: Fix format warnings test

 meson.build | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/meson.build b/meson.build
index 01009b94..34456c93 100644
--- a/meson.build
+++ b/meson.build
@@ -217,19 +217,25 @@ foreach flag : compiler_flags_cxx_required
   assert(cxx.has_argument(flag), flag + ' is required but not supported')
 endforeach
 
-# Meson problem: GCC only accepts the latter 2 options of the 3 below
-# if the first is *also* passed, which doesn't work with get_supported_arguments()
-# above. So just add these unconditionally, since all compilers we support
-# accept these flags.
-
-compiler_flags_format_warnings = [
-# '-Werror=format=2',
-# '-Werror=format-nonliteral',
-# '-Werror=format-security',
+# These flags have to be tested together
+
+compiler_flags_common_multi = [
+  ## These only work together with -Wformat
+  #[
+  #  '-Werror=format=2',
+  #  '-Werror=format-nonliteral',
+  #  '-Werror=format-security',
+  #],
 ]
 
-global_cflags += compiler_flags_format_warnings
-global_cxxflags += compiler_flags_format_warnings
+foreach flags : compiler_flags_common_multi
+  if cc.has_multi_arguments(flags)
+    global_cflags += flags
+  endif
+  if cxx.has_multi_arguments(flags)
+    global_cxxflags += flags
+  endif
+endforeach
 
 # ... and now make these flags the default
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]