diff options
| author | David Seifert <soap@gentoo.org> | 2024-03-06 15:49:42 +0100 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-03-06 14:13:07 -0500 |
| commit | 0cd74c96f1b58fe89ef9565ab40905d04538d7ed (patch) | |
| tree | 6ef5253d120d354bf663e30fd3283bd8db9ff13c | |
| parent | 5e0a3073dad6ec4c4bdbccb755338f01b805fe53 (diff) | |
| download | meson-0cd74c96f1b58fe89ef9565ab40905d04538d7ed.tar.gz | |
cuda: respect host compiler `-Werror`
The cuda compiler also executes the host compiler and generally needs to know
the host compiler flags. We did this for regular args but not for error args.
We use `-Xcompiler=` since that's how nvcc tells the difference between args
it uses itself for device code and args it passes to the host compiler.
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
[eli: fix quoting style]
| -rw-r--r-- | mesonbuild/compilers/cuda.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 0e2d94578..e17ba3f5f 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -199,6 +199,7 @@ class CudaCompiler(Compiler): level: self._to_host_flags(list(f for f in flags if f != '-Wpedantic')) for level, flags in host_compiler.warn_args.items() } + self.host_werror_args = ['-Xcompiler=' + x for x in self.host_compiler.get_werror_args()] @classmethod def _shield_nvcc_list_arg(cls, arg: str, listmode: bool = True) -> str: @@ -708,7 +709,8 @@ class CudaCompiler(Compiler): return cuda_debug_args[is_debug] def get_werror_args(self) -> T.List[str]: - return ['-Werror=cross-execution-space-call,deprecated-declarations,reorder'] + device_werror_args = ['-Werror=cross-execution-space-call,deprecated-declarations,reorder'] + return device_werror_args + self.host_werror_args def get_warn_args(self, level: str) -> T.List[str]: return self.warn_args[level] |
