aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorOlexa Bilaniuk <obilaniu@gmail.com>2021-03-12 18:09:22 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2021-03-28 20:12:45 +0300
commit2579420a72b64c020f9538d8ccbb52fd57c804a1 (patch)
tree9e921ada04ce37f5639f4bf7fa24f4f1593e4777 /mesonbuild/compilers
parent5941e94ff8242591761c634f96efc56e49fedecf (diff)
downloadmeson-cudafix0572.zip
meson-cudafix0572.tar.gz
meson-cudafix0572.tar.bz2
Strip host-compiler -std flag from NVCC line.cudafix0572
Closes #8523.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/cuda.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 0ef92b5..145b7c8 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -617,8 +617,19 @@ class CudaCompiler(Compiler):
return opts
def _to_host_compiler_options(self, options: 'KeyedOptionDictType') -> 'KeyedOptionDictType':
+ """
+ Convert an NVCC Option set to a host compiler's option set.
+ """
+
+ # We must strip the -std option from the host compiler option set, as NVCC has
+ # its own -std flag that may not agree with the host compiler's.
overrides = {name: opt.value for name, opt in options.items()}
- return OptionOverrideProxy(overrides, self.host_compiler.get_options())
+ overrides.pop(OptionKey('std', machine=self.for_machine,
+ lang=self.host_compiler.language), None)
+ host_options = self.host_compiler.get_options().copy()
+ if 'std' in host_options:
+ del host_options['std'] # type: ignore
+ return OptionOverrideProxy(overrides, host_options)
def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
args = self.get_ccbin_args(options)