Skip to content

Commit a2c478f

Browse files
authored
Merge pull request #307 from mixi/master
Pass -static depending on crt-static on linux too.
2 parents 7fef736 + 3bdeefd commit a2c478f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,11 @@ impl Build {
11061106
cmd.args.push("-m64".into());
11071107
}
11081108

1109-
if self.static_flag.is_none() && target.contains("musl") {
1110-
cmd.args.push("-static".into());
1109+
if self.static_flag.is_none() {
1110+
let features = env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new());
1111+
if features.contains("crt-static") {
1112+
cmd.args.push("-static".into());
1113+
}
11111114
}
11121115

11131116
// armv7 targets get to use armv7 instructions

0 commit comments

Comments
 (0)