Skip to content

Commit

Permalink
nvcc: Support -Werror with argument
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Jun 30, 2023
1 parent 799d8f9 commit bebe09a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/compiler/nvcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl CCompilerImpl for Nvcc {

counted_array!(pub static ARGS: [ArgInfo<gcc::ArgData>; _] = [
//todo: refactor show_includes into dependency_args

take_arg!("--Werror", OsString, CanBeSeparated('='), PreprocessorArgument),
take_arg!("--archive-options options", OsString, CanBeSeparated('='), PassThrough),
take_arg!("--compiler-bindir", OsString, CanBeSeparated('='), PassThrough),
take_arg!("--compiler-options", OsString, CanBeSeparated('='), PreprocessorArgument),
Expand All @@ -203,6 +203,7 @@ counted_array!(pub static ARGS: [ArgInfo<gcc::ArgData>; _] = [
take_arg!("--system-include", PathBuf, CanBeSeparated('='), PreprocessorArgumentPath),
take_arg!("--threads", OsString, CanBeSeparated('='), Unhashed),

take_arg!("-Werror", OsString, CanBeSeparated('='), PreprocessorArgument),
take_arg!("-Xarchive", OsString, CanBeSeparated('='), PassThrough),
take_arg!("-Xcompiler", OsString, CanBeSeparated('='), PreprocessorArgument),
take_arg!("-Xlinker", OsString, CanBeSeparated('='), PassThrough),
Expand Down Expand Up @@ -408,7 +409,10 @@ mod test {
"foo.o",
"--include-path",
"include-file",
"-isystem=/system/include/file"
"-isystem=/system/include/file",
"-Werror",
"cross-execution-space-call",
"-Werror=all-warnings"
);
assert_eq!(Some("foo.cpp"), a.input.to_str());
assert_eq!(Language::Cxx, a.language);
Expand All @@ -428,7 +432,11 @@ mod test {
"--include-path",
"include-file",
"-isystem",
"/system/include/file"
"/system/include/file",
"-Werror",
"cross-execution-space-call",
"-Werror",
"all-warnings"
],
a.preprocessor_args
);
Expand Down

0 comments on commit bebe09a

Please sign in to comment.