Skip to content

Commit

Permalink
Allow Windows dylibs without dll suffix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jun 2, 2020
1 parent 0e8a8df commit 8d344dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,9 @@ impl TargetInfo {

// Window shared library import/export files.
if crate_type.is_dynamic() {
if target_triple.ends_with("-windows-msvc") {
assert!(suffix == ".dll");
// Note: Custom JSON specs can alter the suffix. For now, we'll
// just ignore non-DLL suffixes.
if target_triple.ends_with("-windows-msvc") && suffix == ".dll" {
// See https://docs.microsoft.com/en-us/cpp/build/reference/working-with-import-libraries-and-export-files
// for more information about DLL import/export files.
ret.push(FileType {
Expand All @@ -318,8 +319,7 @@ impl TargetInfo {
crate_type: Some(crate_type.clone()),
should_replace_hyphens: true,
});
} else if target_triple.ends_with("windows-gnu") {
assert!(suffix == ".dll");
} else if target_triple.ends_with("windows-gnu") && suffix == ".dll" {
// See https://cygwin.com/cygwin-ug-net/dll.html for more
// information about GNU import libraries.
// LD can link DLL directly, but LLD requires the import library.
Expand Down

0 comments on commit 8d344dc

Please sign in to comment.