diff options
Diffstat (limited to 'mesonbuild/compilers/objcpp.py')
-rw-r--r-- | mesonbuild/compilers/objcpp.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index 003da54..ad909f1 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -14,7 +14,8 @@ import typing as T -from ..mesonlib import MachineChoice +from .. import coredata +from ..mesonlib import MachineChoice, OptionKey from .mixins.clike import CLikeCompiler from .compilers import Compiler @@ -85,6 +86,24 @@ class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler): '3': default_warn_args + ['-Wextra', '-Wpedantic']} + def get_options(self) -> 'coredata.KeyedOptionDictType': + opts = super().get_options() + opts.update({ + OptionKey('std', machine=self.for_machine, lang='cpp'): coredata.UserComboOption( + 'C++ language standard to use', + ['none', 'c++98', 'c++11', 'c++14', 'c++17'], + 'none', + ) + }) + return opts + + def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]: + args = [] + std = options[OptionKey('std', machine=self.for_machine, lang='cpp')] + if std.value != 'none': + args.append('-std=' + std.value) + return args + class AppleClangObjCPPCompiler(ClangObjCPPCompiler): |