From 1209b8820bad58fd3865069b63f3a1125d9824bc Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 10 Jan 2022 09:54:46 -0800 Subject: compilers: push the compiler id to a class variable It really is a per class value, and shouldn't be set per instance. It also allows us to get rid of useless constructors, including those breaking mypy --- mesonbuild/compilers/cs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mesonbuild/compilers/cs.py') diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index 7ebb66d..b38f626 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -40,9 +40,8 @@ class CsCompiler(BasicLinkerIsCompilerMixin, Compiler): language = 'cs' def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, - info: 'MachineInfo', comp_id: str, runner: T.Optional[str] = None): + info: 'MachineInfo', runner: T.Optional[str] = None): super().__init__(exelist, version, for_machine, info) - self.id = comp_id self.runner = runner @classmethod @@ -121,19 +120,20 @@ class CsCompiler(BasicLinkerIsCompilerMixin, Compiler): class MonoCompiler(CsCompiler): + + id = 'mono' + def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, info: 'MachineInfo'): - super().__init__(exelist, version, for_machine, info, 'mono', - runner='mono') + super().__init__(exelist, version, for_machine, info, runner='mono') def rsp_file_syntax(self) -> 'RSPFileSyntax': return RSPFileSyntax.GCC class VisualStudioCsCompiler(CsCompiler): - def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, - info: 'MachineInfo'): - super().__init__(exelist, version, for_machine, info, 'csc') + + id = 'csc' def get_buildtype_args(self, buildtype: str) -> T.List[str]: res = mono_buildtype_args[buildtype] -- cgit v1.1