File tree 5 files changed +14
-7
lines changed
src/cargo/core/compiler/build_context
5 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,17 @@ impl TargetInfo {
257
257
flavor : FileFlavor :: Normal ,
258
258
should_replace_hyphens : false ,
259
259
} )
260
+ } else if target_triple. ends_with ( "windows-gnu" )
261
+ && crate_type. ends_with ( "dylib" )
262
+ && suffix == ".dll"
263
+ {
264
+ // LD can link DLL directly, but LLD requires the import library.
265
+ ret. push ( FileType {
266
+ suffix : ".dll.a" . to_string ( ) ,
267
+ prefix : "lib" . to_string ( ) ,
268
+ flavor : FileFlavor :: Normal ,
269
+ should_replace_hyphens : false ,
270
+ } )
260
271
}
261
272
262
273
// See rust-lang/cargo#4535.
Original file line number Diff line number Diff line change @@ -3810,8 +3810,7 @@ fn cdylib_final_outputs() {
3810
3810
if cfg ! ( target_env = "msvc" ) {
3811
3811
vec ! [ "foo_bar.dll.lib" , "foo_bar.dll" ]
3812
3812
} else {
3813
- // FIXME https://github.com/rust-lang/cargo/pull/6875
3814
- vec ! [ "foo_bar.dll" ]
3813
+ vec ! [ "foo_bar.dll" , "libfoo_bar.dll.a" ]
3815
3814
}
3816
3815
} else if cfg ! ( target_os = "macos" ) {
3817
3816
vec ! [ "libfoo_bar.dylib" ]
Original file line number Diff line number Diff line change @@ -1663,7 +1663,6 @@ fn build_script_with_dynamic_native_dependency() {
1663
1663
let src = root.join(&file);
1664
1664
let dst = out_dir.join(&file);
1665
1665
fs::copy(src, dst).unwrap();
1666
- // FIXME https://github.com/rust-lang/cargo/pull/6875
1667
1666
if cfg!(target_env = "msvc") {
1668
1667
fs::copy(root.join("builder.dll.lib"),
1669
1668
out_dir.join("builder.dll.lib")).unwrap();
Original file line number Diff line number Diff line change @@ -92,8 +92,7 @@ fn dynamic_library_with_debug() {
92
92
& [ "libfoo.so" ] ,
93
93
& [ "libfoo.dylib" ] ,
94
94
& [ "foo.dll" , "foo.dll.lib" ] ,
95
- // FIXME https://github.com/rust-lang/cargo/pull/6875
96
- & [ "foo.dll" ] ,
95
+ & [ "foo.dll" , "libfoo.dll.a" ] ,
97
96
) ;
98
97
}
99
98
Original file line number Diff line number Diff line change @@ -180,8 +180,7 @@ fn plugin_with_dynamic_native_dependency() {
180
180
let src = root.join(&file);
181
181
let dst = out_dir.join(&file);
182
182
fs::copy(src, dst).unwrap();
183
- // FIXME https://github.com/rust-lang/cargo/pull/6875
184
- if cfg!(target_env = "msvc") {
183
+ if cfg!(target_env = "msvc") {
185
184
fs::copy(root.join("builder.dll.lib"),
186
185
out_dir.join("builder.dll.lib")).unwrap();
187
186
}
You can’t perform that action at this time.
0 commit comments