Skip to content

Commit

Permalink
Merge pull request #149 from chenyuanrun/trim_l_prefix
Browse files Browse the repository at this point in the history
Pass -l:libfoo.a to linker directly.
  • Loading branch information
sdroege committed Jul 12, 2023
2 parents 8065740 + ef726e0 commit 576f550
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Expand Up @@ -726,7 +726,11 @@ impl Library {
continue;
}

if statik && is_static_available(val, &system_roots, &dirs) {
if val.starts_with(':') {
// Pass this flag to linker directly.
let meta = format!("cargo:rustc-link-arg={}{}", flag, val);
config.print_metadata(&meta);
} else if statik && is_static_available(val, &system_roots, &dirs) {
let meta = format!("rustc-link-lib=static={}", val);
config.print_metadata(&meta);
} else {
Expand Down

0 comments on commit 576f550

Please sign in to comment.