summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-09-06 10:04:32 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-01-27 09:38:53 -0800
commit30ca64a25b966c7204325e0338afbbb2c6a64d53 (patch)
tree01f75c87c12dcc0c53054565dad7701ec0b65ea2 /mesonbuild/compilers
parentc7036e4cae4508a73ebc2b923d50d53968de38a4 (diff)
downloadmeson-30ca64a25b966c7204325e0338afbbb2c6a64d53.tar.gz
compilers/objc: Use Shared GNU C standard handling
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/objc.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py
index de23e70cf..c563933b4 100644
--- a/mesonbuild/compilers/objc.py
+++ b/mesonbuild/compilers/objc.py
@@ -11,7 +11,7 @@ from .c import ALL_STDS
from .compilers import Compiler
from .mixins.clang import ClangCompiler, ClangCStds
from .mixins.clike import CLikeCompiler
-from .mixins.gnu import GnuCompiler, gnu_common_warning_args, gnu_objc_warning_args
+from .mixins.gnu import GnuCompiler, GnuCStds, gnu_common_warning_args, gnu_objc_warning_args
if T.TYPE_CHECKING:
from .. import coredata
@@ -56,7 +56,7 @@ class ObjCCompiler(CLikeCompiler, Compiler):
return super().form_compileropt_key(basename)
-class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
+class GnuObjCCompiler(GnuCStds, GnuCompiler, ObjCCompiler):
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,
@@ -74,6 +74,13 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
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 ClangObjCCompiler(ClangCStds, ClangCompiler, ObjCCompiler):
def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice,