Auto merge of #81118 - ojeda:metadata-obj, r=nagisa
Skip linking if it is not required This allows to use `--emit=metadata,obj` and other metadata + non-link combinations. Fixes #81117.
This commit is contained in:
commit
a4cbb44ae2
3 changed files with 23 additions and 4 deletions
|
@ -403,6 +403,20 @@ impl OutputTypes {
|
|||
OutputType::Metadata | OutputType::DepInfo => false,
|
||||
})
|
||||
}
|
||||
|
||||
// Returns `true` if any of the output types require linking.
|
||||
pub fn should_link(&self) -> bool {
|
||||
self.0.keys().any(|k| match *k {
|
||||
OutputType::Bitcode
|
||||
| OutputType::Assembly
|
||||
| OutputType::LlvmAssembly
|
||||
| OutputType::Mir
|
||||
| OutputType::Metadata
|
||||
| OutputType::Object
|
||||
| OutputType::DepInfo => false,
|
||||
OutputType::Exe => true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Use tree-based collections to cheaply get a deterministic `Hash` implementation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue