summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-09-25 09:45:21 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-01-27 09:38:53 -0800
commit19b67fbf29faa3d4a90e05722501be128f6ddbd0 (patch)
tree8bafaec79eeed93525c284cfcbb8b1368ed33d50 /mesonbuild
parentfa7716c3005897c52126c086195c85754a1a0e66 (diff)
downloadmeson-19b67fbf29faa3d4a90e05722501be128f6ddbd0.tar.gz
compilers: split Apple C++ version handling to a mixin
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/cpp.py8
-rw-r--r--mesonbuild/compilers/mixins/apple.py8
-rw-r--r--mesonbuild/compilers/objcpp.py3
3 files changed, 13 insertions, 6 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 9626aaceb..46e1ea01b 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -19,7 +19,7 @@ from .compilers import (
CompileCheckMode,
)
from .c_function_attributes import CXX_FUNC_ATTRIBUTES, C_FUNC_ATTRIBUTES
-from .mixins.apple import AppleCompilerMixin
+from .mixins.apple import AppleCompilerMixin, AppleCPPStdsMixin
from .mixins.clike import CLikeCompiler
from .mixins.ccrx import CcrxCompiler
from .mixins.ti import TICompiler
@@ -325,10 +325,8 @@ class ArmLtdClangCPPCompiler(ClangCPPCompiler):
id = 'armltdclang'
-class AppleClangCPPCompiler(AppleCompilerMixin, ClangCPPCompiler):
-
- _CPP23_VERSION = '>=13.0.0'
- _CPP26_VERSION = '>=16.0.0'
+class AppleClangCPPCompiler(AppleCompilerMixin, AppleCPPStdsMixin, ClangCPPCompiler):
+ pass
class EmscriptenCPPCompiler(EmscriptenMixin, ClangCPPCompiler):
diff --git a/mesonbuild/compilers/mixins/apple.py b/mesonbuild/compilers/mixins/apple.py
index 1056e7749..2a0939334 100644
--- a/mesonbuild/compilers/mixins/apple.py
+++ b/mesonbuild/compilers/mixins/apple.py
@@ -68,3 +68,11 @@ class AppleCStdsMixin(Compiler):
_C17_VERSION = '>=10.0.0'
_C18_VERSION = '>=11.0.0'
_C2X_VERSION = '>=11.0.0'
+
+
+class AppleCPPStdsMixin(Compiler):
+
+ """Provide version overrides for the Apple C++ Compilers."""
+
+ _CPP23_VERSION = '>=13.0.0'
+ _CPP26_VERSION = '>=16.0.0'
diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py
index c7af84b79..de968be42 100644
--- a/mesonbuild/compilers/objcpp.py
+++ b/mesonbuild/compilers/objcpp.py
@@ -9,6 +9,7 @@ from ..options import OptionKey, UserStdOption
from .cpp import ALL_STDS
from .compilers import Compiler
+from .mixins.apple import AppleCPPStdsMixin
from .mixins.gnu import GnuCompiler, GnuCPPStds, gnu_common_warning_args, gnu_objc_warning_args
from .mixins.clang import ClangCompiler, ClangCPPStds
from .mixins.clike import CLikeCompiler
@@ -107,6 +108,6 @@ class ClangObjCPPCompiler(ClangCPPStds, ClangCompiler, ObjCPPCompiler):
return args
-class AppleClangObjCPPCompiler(ClangObjCPPCompiler):
+class AppleClangObjCPPCompiler(AppleCPPStdsMixin, ClangObjCPPCompiler):
"""Handle the differences between Apple's clang and vanilla clang."""