From 7ce86cc788673bc805aed010f28daae028143da7 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 11 Apr 2022 20:09:33 +0200 Subject: [PATCH] Handle packages with dashes in bundler --- nih_plug_xtask/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nih_plug_xtask/src/lib.rs b/nih_plug_xtask/src/lib.rs index 78ec7522..d3b8dde2 100644 --- a/nih_plug_xtask/src/lib.rs +++ b/nih_plug_xtask/src/lib.rs @@ -345,10 +345,13 @@ fn target_base(cross_compile_target: Option<&str>) -> Result { /// 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"), } }