aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2024-02-27 12:52:10 +0100
committerEli Schwartz <eschwartz93@gmail.com>2024-02-28 19:34:39 -0500
commit937d1c639a9a83e0671e7e4cd3686ca3e8c9566b (patch)
tree9e6fc770fa4580be71ed5570fbc16300310826b7
parent95e31b756f67f72939dd1587dccca9f497e09a18 (diff)
downloadmeson-937d1c639a9a83e0671e7e4cd3686ca3e8c9566b.zip
meson-937d1c639a9a83e0671e7e4cd3686ca3e8c9566b.tar.gz
meson-937d1c639a9a83e0671e7e4cd3686ca3e8c9566b.tar.bz2
nvcc: avoid adding `-Wpedantic` to compile lines
* `-Wpedantic` creates useless churn due to its use of gcc-line directives: ../foo.cu:1:3: warning: style of line directive is a GCC extension 1 | namespace Foo { | ^~ https://stackoverflow.com/a/31001220
-rw-r--r--mesonbuild/compilers/cuda.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 2ea5d9f..0e2d945 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -192,7 +192,13 @@ class CudaCompiler(Compiler):
self.exe_wrapper = exe_wrapper
self.host_compiler = host_compiler
self.base_options = host_compiler.base_options
- self.warn_args = {level: self._to_host_flags(flags) for level, flags in host_compiler.warn_args.items()}
+ # -Wpedantic generates useless churn due to nvcc's dual compilation model producing
+ # a temporary host C++ file that includes gcc-style line directives:
+ # https://stackoverflow.com/a/31001220
+ self.warn_args = {
+ level: self._to_host_flags(list(f for f in flags if f != '-Wpedantic'))
+ for level, flags in host_compiler.warn_args.items()
+ }
@classmethod
def _shield_nvcc_list_arg(cls, arg: str, listmode: bool = True) -> str: