From f8d86c3b2a35a5e29de0a2589a8b6f7c3582bc69 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 6 Sep 2024 10:10:52 -0700 Subject: [PATCH] compilers/objcpp: Use the GnuCPPStdMixin for ObjC++ --- mesonbuild/compilers/objcpp.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index 8e4f355cd00f..2b4d838f40c0 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -9,7 +9,7 @@ from .mixins.clike import CLikeCompiler from .compilers import Compiler -from .mixins.gnu import GnuCompiler, gnu_common_warning_args, gnu_objc_warning_args +from .mixins.gnu import GnuCompiler, GnuCPPStds, gnu_common_warning_args, gnu_objc_warning_args from .mixins.clang import ClangCompiler, ClangCPPStds if T.TYPE_CHECKING: @@ -58,7 +58,7 @@ def get_options(self) -> coredata.MutableKeyedOptionDictType: return opts -class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler): +class GnuObjCPPCompiler(GnuCPPStds, GnuCompiler, ObjCPPCompiler): def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool, info: 'MachineInfo', defines: T.Optional[T.Dict[str, str]] = None, @@ -76,6 +76,13 @@ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_ self.supported_warn_args(gnu_common_warning_args) + self.supported_warn_args(gnu_objc_warning_args))} + def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]: + args = [] + std = options.get_value(self.form_compileropt_key('std')) + if std != 'none': + args.append('-std=' + std) + return args + class ClangObjCPPCompiler(ClangCPPStds, ClangCompiler, ObjCPPCompiler):