Skip to content

Commit

Permalink
Add -Z dep-info-omit-d-target to control dep-info style
Browse files Browse the repository at this point in the history
This avoids a breaking change to dep-info output, putting the
gcc/clang-compliant dep-info behavior behind a flag
  • Loading branch information
Adam C. Foltzer committed Jan 15, 2018
1 parent 7e99764 commit 8c09d29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8c09d29

Please # to comment.