Skip to content

Commit 8d344dc

Browse files
committed
Allow Windows dylibs without dll suffix.
1 parent 0e8a8df commit 8d344dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cargo/core/compiler/build_context/target_info.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,9 @@ impl TargetInfo {
299299

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

0 commit comments

Comments
 (0)