Skip to content

Commit

Permalink
nvcc: avoid adding -Wpedantic to compile lines
Browse files Browse the repository at this point in the history
* `-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
  • Loading branch information
SoapGentoo committed Feb 27, 2024
1 parent 0dc2499 commit 435d365
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mesonbuild/compilers/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str, for_
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 compilaton 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(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:
Expand Down

0 comments on commit 435d365

Please sign in to comment.