1
0
Fork 0

Handle packages with dashes in bundler

This commit is contained in:
Robbert van der Helm 2022-04-11 20:09:33 +02:00
parent e0c5a3f5e4
commit 7ce86cc788

View file

@ -345,10 +345,13 @@ fn target_base(cross_compile_target: Option<&str>) -> Result<PathBuf> {
/// The file name of the compiled library for a `cdylib` crate.
fn library_basename(package: &str, target: CompilationTarget) -> String {
// Cargo will replace dashes with underscores
let lib_name = package.replace('-', "_");
match target {
CompilationTarget::Linux(_) => format!("lib{package}.so"),
CompilationTarget::MacOS(_) => format!("lib{package}.dylib"),
CompilationTarget::Windows(_) => format!("{package}.dll"),
CompilationTarget::Linux(_) => format!("lib{lib_name}.so"),
CompilationTarget::MacOS(_) => format!("lib{lib_name}.dylib"),
CompilationTarget::Windows(_) => format!("{lib_name}.dll"),
}
}