Skip to content

Commit

Permalink
[Rust]RPATHの設定をした (#203)
Browse files Browse the repository at this point in the history
* RPATHの設定をした

* build.rs で設定できるようになったので不要な処理を削除
  • Loading branch information
qwerty2501 authored Jul 24, 2022
1 parent e7ccd69 commit 1fabf07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions crates/voicevox_core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 1fabf07

Please sign in to comment.