diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 775806052..c8000d0b4 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -90,10 +90,6 @@ jobs: cp -v -n target/${{ matrix.target }}/release/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.*.dylib "artifact/${{ env.ASSET_NAME }}" || true cp -v README.md "artifact/${{ env.ASSET_NAME }}/README.txt" echo "${{ env.VERSION }}" > "artifact/${{ env.ASSET_NAME }}/VERSION" - - name: Set libcore.dylib's identification name (macOS) - if: startsWith(matrix.os, 'macos') - shell: bash - run: install_name_tool -id "@rpath/libcore.dylib" "artifact/${{ env.ASSET_NAME }}/libcore.dylib" - name: Code signing (Windows) if: startsWith(matrix.os, 'windows') && github.event.inputs.code_signing == 'true' shell: bash diff --git a/crates/voicevox_core/build.rs b/crates/voicevox_core/build.rs index 27aba7049..b86dafff7 100644 --- a/crates/voicevox_core/build.rs +++ b/crates/voicevox_core/build.rs @@ -41,6 +41,12 @@ __declspec(dllimport) cbindgen::generate_with_config(&crate_dir, config) .unwrap() .write_to_file(&output_file); + + #[cfg(target_os = "linux")] + println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN"); + + #[cfg(target_os = "macos")] + println!("cargo:rustc-link-arg=-Wl,-install_name,@rpath/libcore.dylib"); } fn target_dir() -> PathBuf { PathBuf::from(env::var("CARGO_WORKSPACE_DIR").unwrap()).join("target")