Skip to content

Commit 576f550

Browse files
authored
Merge pull request #149 from chenyuanrun/trim_l_prefix
Pass -l:libfoo.a to linker directly.
2 parents 8065740 + ef726e0 commit 576f550

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,11 @@ impl Library {
726726
continue;
727727
}
728728

729-
if statik && is_static_available(val, &system_roots, &dirs) {
729+
if val.starts_with(':') {
730+
// Pass this flag to linker directly.
731+
let meta = format!("cargo:rustc-link-arg={}{}", flag, val);
732+
config.print_metadata(&meta);
733+
} else if statik && is_static_available(val, &system_roots, &dirs) {
730734
let meta = format!("rustc-link-lib=static={}", val);
731735
config.print_metadata(&meta);
732736
} else {

0 commit comments

Comments
 (0)