summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <creiter@src.gnome.org>2018-02-22 19:23:28 +0100
committerChristoph Reiter <creiter@src.gnome.org>2018-04-25 17:23:49 +0200
commitd137cebf8f1fc15cec9938fc649e99c382b2a23c (patch)
tree2b0b19baf6d8d6ad1e0c90dc05b29a890d1af8e0
parent384a166ed3284f9557d8b7819d95c1639a492132 (diff)
downloadglib-d137cebf8f1fc15cec9938fc649e99c382b2a23c.tar.gz
meson: Disable -Wformat-nonliteral for the embedded gnulib
glib enables -Werror=format-nonliteral by default which is triggered by the embedded gnulib (in vasnprintf.c). Disable that warning for gnulib alone. The gnulib code is there to handle user provided format strings, so the warning doesn't add anything anyway. This fixes the build under MinGW. https://bugzilla.gnome.org/show_bug.cgi?id=793729
-rw-r--r--glib/gnulib/meson.build6
1 files changed, 5 insertions, 1 deletions
diff --git a/glib/gnulib/meson.build b/glib/gnulib/meson.build
index 44227c611..dac3af739 100644
--- a/glib/gnulib/meson.build
+++ b/glib/gnulib/meson.build
@@ -1,4 +1,8 @@
+# glib enables -Werror=format-nonliteral by default, but the embedded gnulib
+# needs to handle user provided format strings.
+extra_gnulib_args = cc.get_supported_arguments(['-Wno-format-nonliteral'])
+
gnulib_lib = static_library('gnulib', 'asnprintf.c', 'printf.c', 'printf-args.c', 'printf-parse.c', 'vasnprintf.c',
include_directories : [configinc, glibinc],
pic : true,
- c_args : [ '-DLIBDIR="@0@"'.format(get_option('libdir')), '-DGLIB_COMPILATION', '-DG_LOG_DOMAIN="GLib"' ] + glib_hidden_visibility_args)
+ c_args : [ '-DLIBDIR="@0@"'.format(get_option('libdir')), '-DGLIB_COMPILATION', '-DG_LOG_DOMAIN="GLib"' ] + glib_hidden_visibility_args + extra_gnulib_args)