From c998466627914077e7463974a6841bfb9a6393df Mon Sep 17 00:00:00 2001 From: PickledChair Date: Sat, 20 Aug 2022 22:25:55 +0900 Subject: [PATCH 1/2] add rpath setting for macos dylib --- crates/voicevox_core_c_api/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/voicevox_core_c_api/build.rs b/crates/voicevox_core_c_api/build.rs index d97ecd03b..3f44b10c2 100644 --- a/crates/voicevox_core_c_api/build.rs +++ b/crates/voicevox_core_c_api/build.rs @@ -5,6 +5,8 @@ fn main() { #[cfg(target_os = "linux")] println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN"); + #[cfg(target_os = "macos")] + println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path/"); #[cfg(target_os = "macos")] println!("cargo:rustc-link-arg=-Wl,-install_name,@rpath/libcore.dylib"); } From 8e4802727fe59a6e4dfde7b6d2e3924c184889b8 Mon Sep 17 00:00:00 2001 From: Gray Suitcase <41382894+PickledChair@users.noreply.github.com> Date: Sun, 21 Aug 2022 07:34:11 +0900 Subject: [PATCH 2/2] Update crates/voicevox_core_c_api/build.rs Co-authored-by: qwerty2501 <939468+qwerty2501@users.noreply.github.com> --- crates/voicevox_core_c_api/build.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/voicevox_core_c_api/build.rs b/crates/voicevox_core_c_api/build.rs index 3f44b10c2..6bce844c0 100644 --- a/crates/voicevox_core_c_api/build.rs +++ b/crates/voicevox_core_c_api/build.rs @@ -6,9 +6,10 @@ fn main() { println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN"); #[cfg(target_os = "macos")] - println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path/"); - #[cfg(target_os = "macos")] - println!("cargo:rustc-link-arg=-Wl,-install_name,@rpath/libcore.dylib"); + { + println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path/"); + println!("cargo:rustc-link-arg=-Wl,-install_name,@rpath/libcore.dylib"); + } } #[cfg(feature = "generate-c-header")]