aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cuda.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/cuda.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/cuda.py')
-rw-r--r--mesonbuild/compilers/cuda.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 32e75a5..9662dbc 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -173,6 +173,8 @@ class CudaCompiler(Compiler):
# Reverse map -short to --long options.
_FLAG_SHORT2LONG_WITHARGS = {v: k for k, v in _FLAG_LONG2SHORT_WITHARGS.items()}
+ id = 'nvcc'
+
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
is_cross: bool, exe_wrapper: T.Optional['ExternalProgram'],
host_compiler: Compiler, info: 'MachineInfo',
@@ -182,7 +184,6 @@ class CudaCompiler(Compiler):
self.exe_wrapper = exe_wrapper
self.host_compiler = host_compiler
self.base_options = host_compiler.base_options
- self.id = 'nvcc'
self.warn_args = {level: self._to_host_flags(flags) for level, flags in host_compiler.warn_args.items()}
@classmethod