Merge branch 'wip/pwithnall/soft-c11-dependency' into 'main'

build: Add a soft dependency on C11

See merge request GNOME/glib!4473
This commit is contained in:
Philip Withnall 2025-02-04 16:35:33 +00:00
commit 7fffe59037
3 changed files with 14 additions and 4 deletions

View File

@ -120,7 +120,7 @@ development tools appropriate for your operating system, including:
- Meson
- Ninja
- Gettext (19.7 or newer)
- a [C99 compatible compiler](./docs/toolchain-requirements.md)
- a [compatible toolchain](./docs/toolchain-requirements.md)
Up-to-date instructions about developing GNOME applications and libraries
can be found on [the GNOME Developer Center](https://developer.gnome.org).

View File

@ -15,9 +15,8 @@ meson install -C _build # install GLib
Requirements
============
GLib requires a C90-compliant (but not necessarily C99-compliant) C
compiler and libc. On UNIX-like systems, it also assumes compliance
with at least the original 1990 version of POSIX.
GLib requires a [basic C toolchain](./docs/toolchain-requirements.md) and
support for a minimum version of the C standard.
GLib-2.0 requires pkg-config, which is tool for tracking the
compilation flags needed for libraries. (For each library, a small `.pc`

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