From c1076241af11f10acac28d771688bb54c6b0b340 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 27 Nov 2023 15:47:16 -0500 Subject: compilers: No need to pass exe_wrapper everywhere Places where compiler needs it already have access to Environment object and can use it directly. This fixes mypy complaining that not all compilers have self.exe_wrapper in run() method that got moved to base class. --- mesonbuild/compilers/objc.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'mesonbuild/compilers/objc.py') diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index 23008e6..f805bd6 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -14,7 +14,6 @@ from .mixins.gnu import GnuCompiler, gnu_common_warning_args, gnu_objc_warning_a from .mixins.clang import ClangCompiler if T.TYPE_CHECKING: - from ..programs import ExternalProgram from ..envconfig import MachineInfo from ..environment import Environment from ..linkers.linkers import DynamicLinker @@ -27,13 +26,12 @@ class ObjCCompiler(CLikeCompiler, Compiler): def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool, info: 'MachineInfo', - exe_wrap: T.Optional['ExternalProgram'], linker: T.Optional['DynamicLinker'] = None, full_version: T.Optional[str] = None): Compiler.__init__(self, ccache, exelist, version, for_machine, info, is_cross=is_cross, full_version=full_version, linker=linker) - CLikeCompiler.__init__(self, exe_wrap) + CLikeCompiler.__init__(self) @staticmethod def get_display_language() -> str: @@ -47,12 +45,11 @@ class ObjCCompiler(CLikeCompiler, Compiler): class GnuObjCCompiler(GnuCompiler, ObjCCompiler): def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool, info: 'MachineInfo', - exe_wrapper: T.Optional['ExternalProgram'] = None, defines: T.Optional[T.Dict[str, str]] = None, linker: T.Optional['DynamicLinker'] = None, full_version: T.Optional[str] = None): ObjCCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross, - info, exe_wrapper, linker=linker, full_version=full_version) + info, linker=linker, full_version=full_version) GnuCompiler.__init__(self, defines) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], @@ -67,12 +64,11 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler): class ClangObjCCompiler(ClangCompiler, ObjCCompiler): def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool, info: 'MachineInfo', - exe_wrapper: T.Optional['ExternalProgram'] = None, defines: T.Optional[T.Dict[str, str]] = None, linker: T.Optional['DynamicLinker'] = None, full_version: T.Optional[str] = None): ObjCCompiler.__init__(self, ccache, exelist, version, for_machine, is_cross, - info, exe_wrapper, linker=linker, full_version=full_version) + info, linker=linker, full_version=full_version) ClangCompiler.__init__(self, defines) default_warn_args = ['-Wall', '-Winvalid-pch'] self.warn_args = {'0': [], -- cgit v1.1