summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
Diffstat (limited to 'rust')
-rw-r--r--rust/README.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/rust/README.md b/rust/README.md
index 9aa3a81c..1edd1d90 100644
--- a/rust/README.md
+++ b/rust/README.md
@@ -73,13 +73,20 @@ fn main() {
println!("cargo::rustc-link-lib=dylib=binaryninjacore");
println!("cargo::rustc-link-search={}", link_path.to_str().unwrap());
- #[cfg(not(target_os = "windows"))]
+ #[cfg(target_os = "linux")]
{
println!(
"cargo::rustc-link-arg=-Wl,-rpath,{0},-L{0}",
link_path.to_string_lossy()
);
}
+
+ #[cfg(target_os = "macos")]
+ {
+ let crate_name = std::env::var("CARGO_PKG_NAME").expect("CARGO_PKG_NAME not set");
+ let lib_name = crate_name.replace('-', "_");
+ println!("cargo::rustc-link-arg=-Wl,-install_name,@rpath/lib{}.dylib", lib_name);
+ }
}
```