Skip to content

Commit

Permalink
Fix --meson-paths for shared libs under MSVC
Browse files Browse the repository at this point in the history
Shared libraries under MSVC are always in the form `foo.dll`.
  • Loading branch information
kleisauke committed Jan 7, 2025
1 parent 44e96dc commit 9cf2de8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/build_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,18 @@ impl BuildTargets {
}

pub fn shared_output_file_name(&self) -> Option<OsString> {
if self.shared_lib.is_some() && self.use_meson_naming_convention {
Some(format!("lib{}.dll", self.name).into())
} else {
Some(self.shared_lib.as_ref()?.file_name().unwrap().to_owned())
match self.lib_type() {
LibType::Windows => {
if self.shared_lib.is_some()
&& self.use_meson_naming_convention
&& self.target.env == "gnu"
{
Some(format!("lib{}.dll", self.name).into())
} else {
Some(self.shared_lib.as_ref()?.file_name()?.to_owned())
}
}
_ => Some(self.shared_lib.as_ref()?.file_name()?.to_owned()),
}
}
}
Expand Down

0 comments on commit 9cf2de8

Please sign in to comment.