Use command line metadata path if provided

If the command-line has `--emit metadata=some/path/libfoo.rmeta` then
use that.

Closes #85356
This commit is contained in:
Jeremy Fitzhardinge 2021-05-16 02:06:00 -07:00 committed by Jeremy Fitzhardinge
parent 6f9df55a78
commit 2835351feb

View file

@ -127,6 +127,11 @@ pub fn filename_for_metadata(
crate_name: &str,
outputs: &OutputFilenames,
) -> PathBuf {
// If the command-line specified the path, use that directly.
if let Some(Some(out_filename)) = sess.opts.output_types.get(&OutputType::Metadata) {
return out_filename.clone();
}
let libname = format!("{}{}", crate_name, sess.opts.cg.extra_filename);
let out_filename = outputs