Skip to content

Commit

Permalink
Add implib to the stamp files
Browse files Browse the repository at this point in the history
This was already done when targetting msvc, but it needs to be done for
all targets to allow rustc to link with shared libraries when using llvm
-l<dllname> is only supported by gcc, while llvm needs an import library
to link indirectly with a dll
  • Loading branch information
chouquette committed Apr 17, 2019
1 parent b6581d3 commit 65173f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ impl TargetInfo {
should_replace_hyphens: false,
})
}
else if (target_triple.ends_with("pc-windows-gnu") ||
target_triple.ends_with("pc-uwp-gnu"))
&& crate_type.ends_with("dylib")
&& suffix == ".dll"
{
ret.push(FileType {
suffix: ".dll.a".to_string(),
prefix: "lib".to_string(),
flavor: FileFlavor::Normal,
should_replace_hyphens: false,
})
}

// See rust-lang/cargo#4535.
if target_triple.starts_with("wasm32-") && crate_type == "bin" && suffix == ".js" {
Expand Down

0 comments on commit 65173f6

Please sign in to comment.