Skip to content

Commit 8c09d29

Browse files
author
Adam C. Foltzer
committed
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
1 parent 7e99764 commit 8c09d29

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc/session/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,9 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
12361236
overriding the default for the current target"),
12371237
human_readable_cgu_names: bool = (false, parse_bool, [TRACKED],
12381238
"generate human-readable, predictable names for codegen units"),
1239+
dep_info_omit_d_target: bool = (false, parse_bool, [TRACKED],
1240+
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
1241+
themselves"),
12391242
}
12401243

12411244
pub fn default_lib_output() -> CrateType {

src/librustc_driver/driver.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,9 @@ fn write_out_deps(sess: &Session, outputs: &OutputFilenames, crate_name: &str) {
11621162
out_filenames.push(p);
11631163
}
11641164
}
1165-
// Do not include the dep-info file in itself as a target
1166-
OutputType::DepInfo => { }
1165+
OutputType::DepInfo if sess.opts.debugging_opts.dep_info_omit_d_target => {
1166+
// Don't add the dep-info output when omitting it from dep-info targets
1167+
}
11671168
_ => {
11681169
out_filenames.push(file);
11691170
}

0 commit comments

Comments
 (0)