call Cargo::configure_linker only for specific commands
Calling `Cargo::configure_linker` unconditionally slows down certain commands (e.g., "check" command) without providing any benefit. Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
parent
60d146580c
commit
9a29081b49
1 changed files with 9 additions and 1 deletions
|
|
@ -2446,7 +2446,15 @@ impl Cargo {
|
|||
cmd_kind: Kind,
|
||||
) -> Cargo {
|
||||
let mut cargo = builder.cargo(compiler, mode, source_type, target, cmd_kind);
|
||||
cargo.configure_linker(builder);
|
||||
|
||||
match cmd_kind {
|
||||
// No need to configure the target linker for these command types.
|
||||
Kind::Clean | Kind::Check | Kind::Suggest | Kind::Format | Kind::Setup => {}
|
||||
_ => {
|
||||
cargo.configure_linker(builder);
|
||||
}
|
||||
}
|
||||
|
||||
cargo
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue