diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2024-08-29 10:22:53 -0700 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-02-05 17:45:38 +0200 |
| commit | fe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c (patch) | |
| tree | fe25957a1db43513a0b61183d431b498dea40013 /mesonbuild/compilers/cuda.py | |
| parent | f0a6ba380989c68ecc5af61087157557b329f808 (diff) | |
| download | meson-fe9f8de1ab52af0a6f4c3a1ce054ee3e2eb7a74c.tar.gz | |
compilers: remove Compiler.create_option
This saves a *tiny* bit of typing, but at the cost of requiring either
the current solution of throwing up our hands and saying "typing is too
hard, better to have bugs!" or an extensive amount of `TypedDict`s,
`overloads`, and a very new version of mypy. Let's get our type safety
back, even if it means writing a little bit more code.
Diffstat (limited to 'mesonbuild/compilers/cuda.py')
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 38a938f24..07fda95dd 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -646,18 +646,22 @@ class CudaCompiler(Compiler): if version_compare(self.version, self._CPP20_VERSION): cpp_stds += ['c++20'] - return self.update_options( - super().get_options(), - self.create_option(options.UserComboOption, - self.form_compileropt_key('std'), - 'C++ language standard to use with CUDA', - cpp_stds, - 'none'), - self.create_option(options.UserStringOption, - self.form_compileropt_key('ccbindir'), - 'CUDA non-default toolchain directory to use (-ccbin)', - ''), - ) + opts = super().get_options() + + key = self.form_compileropt_key('std') + opts[key] = options.UserComboOption( + self.make_option_name(key), + 'C++ language standard to use with CUDA', + cpp_stds, + 'none') + + key = self.form_compileropt_key('ccbindir') + opts[key] = options.UserStringOption( + self.make_option_name(key), + 'CUDA non-default toolchain directory to use (-ccbin)', + '') + + return opts def _to_host_compiler_options(self, master_options: 'KeyedOptionDictType') -> 'KeyedOptionDictType': """ |
