add whether LinkerFlavor
uses lld
This commit is contained in:
parent
f4b80cacf9
commit
99605a0389
@ -349,6 +349,24 @@ pub fn lld_flavor(self) -> LldFlavor {
|
||||
pub fn is_gnu(self) -> bool {
|
||||
matches!(self, LinkerFlavor::Gnu(..))
|
||||
}
|
||||
|
||||
/// Returns whether the flavor uses the `lld` linker.
|
||||
pub fn uses_lld(self) -> bool {
|
||||
// Exhaustive match in case new flavors are added in the future.
|
||||
match self {
|
||||
LinkerFlavor::Gnu(_, Lld::Yes)
|
||||
| LinkerFlavor::Darwin(_, Lld::Yes)
|
||||
| LinkerFlavor::WasmLld(..)
|
||||
| LinkerFlavor::EmCc
|
||||
| LinkerFlavor::Msvc(Lld::Yes) => true,
|
||||
LinkerFlavor::Gnu(..)
|
||||
| LinkerFlavor::Darwin(..)
|
||||
| LinkerFlavor::Msvc(_)
|
||||
| LinkerFlavor::Unix(_)
|
||||
| LinkerFlavor::Bpf
|
||||
| LinkerFlavor::Ptx => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! linker_flavor_cli_impls {
|
||||
|
Loading…
Reference in New Issue
Block a user