cpp: handle Apple Clang deprecation of hardening macro for old versions too

a16ec8b0fb changed the threshold to 17
for Apple Clang, but it needs to be 16 instead.

Bug: https://github.com/mesonbuild/meson/issues/14440
Closes: https://github.com/mesonbuild/meson/issues/14856
This commit is contained in:
Sam James
2025-07-31 17:25:14 +01:00
committed by Eli Schwartz
parent e99253c1bd
commit 14c2300dde

View File

@@ -349,9 +349,10 @@ class AppleClangCPPCompiler(AppleCompilerMixin, AppleCPPStdsMixin, ClangCPPCompi
def is_libcpp_enable_assertions_deprecated(self) -> bool:
# Upstream libc++ deprecated _LIBCPP_ENABLE_ASSERTIONS
# in favor of _LIBCPP_HARDENING_MODE from version 18 onwards,
# but Apple Clang 17's libc++ has back-ported that change.
# See: https://github.com/mesonbuild/meson/issues/14440
return version_compare(self.version, ">=17")
# but Apple Clang 16's libc++ has back-ported that change.
# See: https://github.com/mesonbuild/meson/issues/14440 and
# https://github.com/mesonbuild/meson/issues/14856
return version_compare(self.version, ">=16")
class EmscriptenCPPCompiler(EmscriptenMixin, ClangCPPCompiler):