From 445eea668a5953610d7a4a8e6eac22c6e4fa3610 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 4 Feb 2025 15:59:51 +0000 Subject: [PATCH] build: Add a soft dependency on C11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will warn if GLib is configured with a toolchain which doesn’t support C11. We currently require C99. If nobody complains (as directed by this warning) we will start to require C11 in the next unstable release series (2.85). See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3574#note_1859924 Signed-off-by: Philip Withnall --- meson.build | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/meson.build b/meson.build index f453d748c..f0820909b 100644 --- a/meson.build +++ b/meson.build @@ -25,6 +25,17 @@ foreach std : ['89', '99', '11', '17'] endif endforeach +# In the 2.85 cycle, this soft-dependency on C11 will become a hard dependency. +# If this is a problem on your toolchain or platform, please file an issue +# (https://gitlab.gnome.org/GNOME/glib/-/issues) and let us know. We have very +# few metrics on the toolchains which are used to build GLib. +if '11' not in c_standards + warning('Toolchain support for C11 will become a requirement for building ' + + 'GLib in the next unstable development series (2.85). If this is ' + + 'problematic for you, please file an issue ' + + '(https://gitlab.gnome.org/GNOME/glib/-/issues) now') +endif + have_cxx = add_languages('cpp', native: false, required: get_option('oss_fuzz').enabled()) if have_cxx cxx = meson.get_compiler('cpp')