build: Add a soft dependency on C11

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 <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2025-02-04 15:59:51 +00:00
parent 97fdba0d2f
commit 445eea668a
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -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')