Skip to content

Commit e433cec

Browse files
nshpreitermarkus
authored andcommitted
Pass extra link args to all linked targets
1 parent 48913c3 commit e433cec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ const RUSTDOC_CRATE_VERSION_FLAG: &str = "--crate-version";
6363
pub enum LinkType {
6464
Cdylib,
6565
Bin,
66+
Test,
67+
Bench,
68+
Example,
6669
}
6770

6871
impl From<&super::Target> for Option<LinkType> {
@@ -71,6 +74,12 @@ impl From<&super::Target> for Option<LinkType> {
7174
Some(LinkType::Cdylib)
7275
} else if value.is_bin() {
7376
Some(LinkType::Bin)
77+
} else if value.is_test() {
78+
Some(LinkType::Test)
79+
} else if value.is_bench() {
80+
Some(LinkType::Bench)
81+
} else if value.is_exe_example() {
82+
Some(LinkType::Example)
7483
} else {
7584
None
7685
}

0 commit comments

Comments
 (0)