Skip to content

Commit 0a298ed

Browse files
committed
Show files produced by --emit foo in json artifact notifications
1 parent fbac8ef commit 0a298ed

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/driver/aot.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,29 @@ fn produce_final_output_artifacts(
287287
}
288288
}
289289

290+
if sess.opts.json_artifact_notifications {
291+
if codegen_results.modules.len() == 1 {
292+
codegen_results.modules[0].for_each_output(|_path, ty| {
293+
if sess.opts.output_types.contains_key(&ty) {
294+
let descr = ty.shorthand();
295+
// for single cgu file is renamed to drop cgu specific suffix
296+
// so we regenerate it the same way
297+
let path = crate_output.path(ty);
298+
sess.dcx().emit_artifact_notification(path.as_path(), descr);
299+
}
300+
});
301+
} else {
302+
for module in &codegen_results.modules {
303+
module.for_each_output(|path, ty| {
304+
if sess.opts.output_types.contains_key(&ty) {
305+
let descr = ty.shorthand();
306+
sess.dcx().emit_artifact_notification(&path, descr);
307+
}
308+
});
309+
}
310+
}
311+
}
312+
290313
// We leave the following files around by default:
291314
// - #crate#.o
292315
// - #crate#.crate.metadata.o

0 commit comments

Comments
 (0)