Add -Z dep-info-omit-d-target to control dep-info style

This avoids a breaking change to dep-info output, putting the
gcc/clang-compliant dep-info behavior behind a flag
This commit is contained in:
Adam C. Foltzer 2018-01-15 13:08:27 -08:00
parent 7e99764df3
commit 8c09d29d04
2 changed files with 6 additions and 2 deletions

View file

@ -1236,6 +1236,9 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
overriding the default for the current target"),
human_readable_cgu_names: bool = (false, parse_bool, [TRACKED],
"generate human-readable, predictable names for codegen units"),
dep_info_omit_d_target: bool = (false, parse_bool, [TRACKED],
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
themselves"),
}
pub fn default_lib_output() -> CrateType {

View file

@ -1162,8 +1162,9 @@ fn write_out_deps(sess: &Session, outputs: &OutputFilenames, crate_name: &str) {
out_filenames.push(p);
}
}
// Do not include the dep-info file in itself as a target
OutputType::DepInfo => { }
OutputType::DepInfo if sess.opts.debugging_opts.dep_info_omit_d_target => {
// Don't add the dep-info output when omitting it from dep-info targets
}
_ => {
out_filenames.push(file);
}