aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/d.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-01-10 09:54:46 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-01-10 15:53:26 -0500
commit1209b8820bad58fd3865069b63f3a1125d9824bc (patch)
tree95b8e6d0e706d377b8cfbf46f44a503097386e85 /mesonbuild/compilers/d.py
parentf67994476da4bdc5389c558989809df48a172c6e (diff)
downloadmeson-1209b8820bad58fd3865069b63f3a1125d9824bc.zip
meson-1209b8820bad58fd3865069b63f3a1125d9824bc.tar.gz
meson-1209b8820bad58fd3865069b63f3a1125d9824bc.tar.bz2
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
Diffstat (limited to 'mesonbuild/compilers/d.py')
-rw-r--r--mesonbuild/compilers/d.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index a83c15b..bae293e 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -681,6 +681,7 @@ class GnuDCompiler(GnuCompiler, DCompiler):
# we mostly want DCompiler, but that gives us the Compiler.LINKER_PREFIX instead
LINKER_PREFIX = GnuCompiler.LINKER_PREFIX
+ id = 'gcc'
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
info: 'MachineInfo', arch: str, *,
@@ -692,7 +693,6 @@ class GnuDCompiler(GnuCompiler, DCompiler):
exe_wrapper=exe_wrapper, linker=linker,
full_version=full_version, is_cross=is_cross)
GnuCompiler.__init__(self, {})
- self.id = 'gcc'
default_warn_args = ['-Wall', '-Wdeprecated']
self.warn_args = {'0': [],
'1': default_warn_args,
@@ -760,6 +760,8 @@ def find_ldc_dmd_frontend_version(version_output: T.Optional[str]) -> T.Optional
class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
+ id = 'llvm'
+
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
info: 'MachineInfo', arch: str, *,
exe_wrapper: T.Optional['ExternalProgram'] = None,
@@ -770,7 +772,6 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
exe_wrapper=exe_wrapper, linker=linker,
full_version=full_version, is_cross=is_cross)
DmdLikeCompilerMixin.__init__(self, dmd_frontend_version=find_ldc_dmd_frontend_version(version_output))
- self.id = 'llvm'
self.base_options = {OptionKey(o) for o in ['b_coverage', 'b_colorout', 'b_vscrt', 'b_ndebug']}
def get_colorout_args(self, colortype: str) -> T.List[str]:
@@ -824,6 +825,8 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
class DmdDCompiler(DmdLikeCompilerMixin, DCompiler):
+ id = 'dmd'
+
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
info: 'MachineInfo', arch: str, *,
exe_wrapper: T.Optional['ExternalProgram'] = None,
@@ -834,7 +837,6 @@ class DmdDCompiler(DmdLikeCompilerMixin, DCompiler):
exe_wrapper=exe_wrapper, linker=linker,
full_version=full_version, is_cross=is_cross)
DmdLikeCompilerMixin.__init__(self, version)
- self.id = 'dmd'
self.base_options = {OptionKey(o) for o in ['b_coverage', 'b_colorout', 'b_vscrt', 'b_ndebug']}
def get_colorout_args(self, colortype: str) -> T.List[str]: