From b4643a1ac81f6a7b65e6e0fd8e6bd332b85a73d1 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Wed, 6 Mar 2024 15:22:48 +0100 Subject: [PATCH] cuda: respect host compiler `-Werror` * Currently, running Meson with `--werror` only adds a select few -Werror options that trigger only for device, not host code. In general, users expect `--werror` to also error out on warnings in host code with nvcc. --- mesonbuild/compilers/cuda.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 0e2d9457850e..db5f5debfb85 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -708,7 +708,9 @@ def get_debug_args(self, is_debug: bool) -> T.List[str]: return cuda_debug_args[is_debug] def get_werror_args(self) -> T.List[str]: - return ['-Werror=cross-execution-space-call,deprecated-declarations,reorder'] + return [ + "-Werror=cross-execution-space-call,deprecated-declarations,reorder" + ] + ["-Xcompiler=" + x for x in self.host_compiler.get_werror_args()] def get_warn_args(self, level: str) -> T.List[str]: return self.warn_args[level]