summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-10-28 09:58:09 +0000
committerEli Schwartz <eschwartz93@gmail.com>2025-10-31 01:24:46 -0400
commit6ad2c919087c75254c8fe19b2a76102883358f1b (patch)
tree863917aec101186976e25631f5bb9dc0aba31cb0
parent5403a9dea78eee5e42267aaeeb1609ec5c9db18a (diff)
downloadmeson-6ad2c919087c75254c8fe19b2a76102883358f1b.tar.gz
compilers: cpp: explain more wrt GCC versions vs assertions
Bug: https://github.com/mesonbuild/meson/issues/13978
-rw-r--r--mesonbuild/compilers/cpp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 57da4dfae..47087b694 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -526,11 +526,15 @@ class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler):
if self.defines.get(macro) is not None:
return []
+ # For GCC, we can assume that the libstdc++ version is the same as
+ # the compiler itself. Anything else isn't supported.
if self.language_stdlib_provider(env) == 'stdc++':
return ['-D_GLIBCXX_ASSERTIONS=1']
else:
# One can use -stdlib=libc++ with GCC, it just (as of 2025) requires
- # an experimental configure arg to expose that.
+ # an experimental configure arg to expose that. libc++ supports "multiple"
+ # versions of GCC (only ever one version of GCC per libc++ version), but
+ # that is "multiple" for our purposes as we can't assume a mapping.
if version_compare(self.version, '>=18'):
return ['-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST']