diff --git a/src/install.rs b/src/install.rs index d0c0dbe6..c56340ad 100644 --- a/src/install.rs +++ b/src/install.rs @@ -110,10 +110,14 @@ impl UnixLibNames { match lib_type { LibType::So => { let lib = format!("lib{lib_name}.so"); - let lib_with_major_ver = format!("{}.{}", lib, lib_version.major); + let lib_with_major_ver = if lib_version.major == 0 { + format!("{}.{}.{}", lib, lib_version.major, lib_version.minor) + } else { + format!("{}.{}", lib, lib_version.major) + }; let lib_with_full_ver = format!( - "{}.{}.{}", - lib_with_major_ver, lib_version.minor, lib_version.patch + "{}.{}.{}.{}", + lib, lib_version.major, lib_version.minor, lib_version.patch ); Some(Self { canonical: lib, diff --git a/src/target.rs b/src/target.rs index 975fde5c..d730ce04 100644 --- a/src/target.rs +++ b/src/target.rs @@ -70,7 +70,11 @@ impl Target { let env = &self.env; let sover = if major == 0 { - format!("{major}.{minor}") + if minor == 0 { + format!("{major}.{minor}.{patch}") + } else { + format!("{major}.{minor}") + } } else { format!("{major}") };