@@ -228,10 +228,19 @@ pub fn cinstall(ws: &Workspace, packages: &[CPackage]) -> anyhow::Result<()> {
228
228
229
229
if let Some ( ref static_lib) = build_targets. static_lib {
230
230
ws. gctx ( ) . shell ( ) . status ( "Installing" , "static library" ) ?;
231
- copy (
232
- static_lib,
233
- install_path_lib. join ( static_lib. file_name ( ) . unwrap ( ) ) ,
234
- ) ?;
231
+ let lib_type = LibType :: from_build_targets ( build_targets) ;
232
+ let file_name = match lib_type {
233
+ LibType :: Windows => {
234
+ if build_targets. use_meson_naming_convention {
235
+ format ! ( "lib{}.a" , build_targets. name) . into ( )
236
+ } else {
237
+ static_lib. file_name ( ) . unwrap ( ) . to_owned ( )
238
+ }
239
+ }
240
+ _ => static_lib. file_name ( ) . unwrap ( ) . to_owned ( ) ,
241
+ } ;
242
+
243
+ copy ( static_lib, install_path_lib. join ( file_name) ) ?;
235
244
}
236
245
237
246
if let Some ( ref debug_info) = build_targets. debug_info {
@@ -268,7 +277,11 @@ pub fn cinstall(ws: &Workspace, packages: &[CPackage]) -> anyhow::Result<()> {
268
277
lib. install ( capi_config, shared_lib, & install_path_lib) ?;
269
278
}
270
279
LibType :: Windows => {
271
- let lib_name = shared_lib. file_name ( ) . unwrap ( ) ;
280
+ let lib_name = if build_targets. use_meson_naming_convention {
281
+ format ! ( "lib{}.dll" , build_targets. name) . into ( )
282
+ } else {
283
+ shared_lib. file_name ( ) . unwrap ( ) . to_owned ( )
284
+ } ;
272
285
273
286
if capi_config. library . install_subdir . is_none ( ) {
274
287
let install_path_bin = append_to_destdir ( destdir. as_deref ( ) , & paths. bindir ) ;
@@ -281,7 +294,11 @@ pub fn cinstall(ws: &Workspace, packages: &[CPackage]) -> anyhow::Result<()> {
281
294
}
282
295
if capi_config. library . import_library {
283
296
let impl_lib = build_targets. impl_lib . as_ref ( ) . unwrap ( ) ;
284
- let impl_lib_name = impl_lib. file_name ( ) . unwrap ( ) ;
297
+ let impl_lib_name = if build_targets. use_meson_naming_convention {
298
+ format ! ( "{}.lib" , build_targets. name) . into ( )
299
+ } else {
300
+ impl_lib. file_name ( ) . unwrap ( ) . to_owned ( )
301
+ } ;
285
302
copy ( impl_lib, install_path_lib. join ( impl_lib_name) ) ?;
286
303
let def = build_targets. def . as_ref ( ) . unwrap ( ) ;
287
304
let def_name = def. file_name ( ) . unwrap ( ) ;
0 commit comments