Skip to content

Commit

Permalink
Complete the soversion granularity
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Oct 10, 2023
1 parent 712a0c4 commit 45f5424
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
};
Expand Down

0 comments on commit 45f5424

Please sign in to comment.