Skip to content

Commit 2835351

Browse files
committed
Use command line metadata path if provided
If the command-line has `--emit metadata=some/path/libfoo.rmeta` then use that. Closes rust-lang#85356
1 parent 6f9df55 commit 2835351

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_session/src/output.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ pub fn filename_for_metadata(
127127
crate_name: &str,
128128
outputs: &OutputFilenames,
129129
) -> PathBuf {
130+
// If the command-line specified the path, use that directly.
131+
if let Some(Some(out_filename)) = sess.opts.output_types.get(&OutputType::Metadata) {
132+
return out_filename.clone();
133+
}
134+
130135
let libname = format!("{}{}", crate_name, sess.opts.cg.extra_filename);
131136

132137
let out_filename = outputs

0 commit comments

Comments
 (0)