Skip to content

Commit

Permalink
Pass through clang color diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanhs authored and froydnj committed Aug 21, 2019
1 parent bf41588 commit a7611fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/compiler/clang.rs
Expand Up @@ -86,6 +86,7 @@ counted_array!(pub static ARGS: [ArgInfo<gcc::ArgData>; _] = [
take_arg!("--target", OsString, Separated, PassThrough),
take_arg!("-Xclang", OsString, Separated, XClang),
take_arg!("-add-plugin", OsString, Separated, PassThrough),
flag!("-fcolor-diagnostics", PassThroughFlag),
flag!("-fcxx-modules", TooHardFlag),
take_arg!("-fdebug-compilation-dir", OsString, Separated, PassThrough),
flag!("-fmodules", TooHardFlag),
Expand Down
6 changes: 6 additions & 0 deletions src/compiler/gcc.rs
Expand Up @@ -76,6 +76,9 @@ impl CCompilerImpl for GCC {
ArgData!{ pub
TooHardFlag,
TooHard(OsString),
// Should only be necessary for -Xclang flags - unknown flags not hidden behind
// that are assumed to not affect compilation
PassThroughFlag,
PassThrough(OsString),
PassThroughPath(PathBuf),
PreprocessorArgumentFlag,
Expand Down Expand Up @@ -249,6 +252,7 @@ where
Some(PreprocessorArgumentFlag) |
Some(PreprocessorArgument(_)) |
Some(PreprocessorArgumentPath(_)) |
Some(PassThroughFlag) |
Some(PassThrough(_)) |
Some(PassThroughPath(_)) => {}
Some(Language(lang)) => {
Expand Down Expand Up @@ -279,6 +283,7 @@ where
Some(ProfileGenerate) |
Some(TestCoverage) |
Some(Coverage) |
Some(PassThroughFlag) |
Some(PassThrough(_)) |
Some(PassThroughPath(_)) => &mut common_args,
Some(ExtraHashFile(path)) => {
Expand Down Expand Up @@ -340,6 +345,7 @@ where
_ => unreachable!(),
}
}
Some(PassThroughFlag) |
Some(PassThrough(_)) |
Some(PassThroughPath(_)) => &mut common_args,
Some(ExtraHashFile(path)) => {
Expand Down
1 change: 1 addition & 0 deletions src/compiler/msvc.rs
Expand Up @@ -350,6 +350,7 @@ pub fn parse_arguments(arguments: &[OsString], cwd: &Path, is_clang: bool) -> Co
_ => unreachable!(),
}
}
Some(PassThroughFlag) |
Some(PassThrough(_)) |
Some(PassThroughPath(_)) => &mut common_args,
Some(ExtraHashFile(path)) => {
Expand Down

0 comments on commit a7611fd

Please sign in to comment.