From 0c22798b1ad4678abb205280060175678a790c4a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 21 Aug 2019 13:12:30 -0700 Subject: compilers: replace CompilerType with MachineInfo Now that the linkers are split out of the compilers this enum is only used to know what platform we're compiling for. Which is what the MachineInfo class is for --- mesonbuild/compilers/objc.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'mesonbuild/compilers/objc.py') diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index 1004a72..58f3ec5 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -22,10 +22,16 @@ from .mixins.clike import CLikeCompiler from .mixins.gnu import GnuCompiler from .mixins.clang import ClangCompiler +if typing.TYPE_CHECKING: + from ..envconfig import MachineInfo + + class ObjCCompiler(CLikeCompiler, Compiler): - def __init__(self, exelist, version, for_machine: MachineChoice, is_cross: bool, exe_wrap: typing.Optional[str], **kwargs): + def __init__(self, exelist, version, for_machine: MachineChoice, + is_cross: bool, info: 'MachineInfo', + exe_wrap: typing.Optional[str], **kwargs): self.language = 'objc' - Compiler.__init__(self, exelist, version, for_machine, **kwargs) + Compiler.__init__(self, exelist, version, for_machine, info, **kwargs) CLikeCompiler.__init__(self, is_cross, exe_wrap) def get_display_language(self): @@ -57,9 +63,12 @@ class ObjCCompiler(CLikeCompiler, Compiler): class GnuObjCCompiler(GnuCompiler, ObjCCompiler): - def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, defines=None, **kwargs): - ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) - GnuCompiler.__init__(self, compiler_type, defines) + def __init__(self, exelist, version, for_machine: MachineChoice, + is_cross, info: 'MachineInfo', exe_wrapper=None, + defines=None, **kwargs): + ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, + info, exe_wrapper, **kwargs) + GnuCompiler.__init__(self, defines) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, @@ -68,9 +77,12 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler): class ClangObjCCompiler(ClangCompiler, ObjCCompiler): - def __init__(self, exelist, version, compiler_type, for_machine: MachineChoice, is_cross, exe_wrapper=None, **kwargs): - ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, exe_wrapper, **kwargs) - ClangCompiler.__init__(self, compiler_type) + def __init__(self, exelist, version, for_machine: MachineChoice, + is_cross, info: 'MachineInfo', exe_wrapper=None, + **kwargs): + ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross, + info, exe_wrapper, **kwargs) + ClangCompiler.__init__(self) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], '1': default_warn_args, -- cgit v1.1