Skip to content

Commit 8815a9f

Browse files
committed
Fix --meson-paths for shared libs under MSVC
Shared libraries under MSVC are always in the form `foo.dll`.
1 parent 647f9bc commit 8815a9f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/build_targets.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,18 @@ impl BuildTargets {
129129
}
130130

131131
pub fn shared_output_file_name(&self) -> Option<OsString> {
132-
if self.shared_lib.is_some() && self.use_meson_naming_convention {
133-
Some(format!("lib{}.dll", self.name).into())
134-
} else {
135-
Some(self.shared_lib.as_ref()?.file_name().unwrap().to_owned())
132+
match self.lib_type() {
133+
LibType::Windows => {
134+
if self.shared_lib.is_some()
135+
&& self.use_meson_naming_convention
136+
&& self.target.env == "gnu"
137+
{
138+
Some(format!("lib{}.dll", self.name).into())
139+
} else {
140+
Some(self.shared_lib.as_ref()?.file_name()?.to_owned())
141+
}
142+
}
143+
_ => Some(self.shared_lib.as_ref()?.file_name()?.to_owned()),
136144
}
137145
}
138146
}

0 commit comments

Comments
 (0)