Skip to content

Commit eab54b0

Browse files
committed
Fix rpath of workflow_objc on macOS
1 parent c56a375 commit eab54b0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

plugins/workflow_objc/build.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@ fn main() {
55
println!("cargo::rustc-link-lib=dylib=binaryninjacore");
66
println!("cargo::rustc-link-search={}", link_path.to_str().unwrap());
77

8-
#[cfg(not(target_os = "windows"))]
8+
#[cfg(target_os = "linux")]
99
{
1010
println!(
1111
"cargo::rustc-link-arg=-Wl,-rpath,{0},-L{0}",
1212
link_path.to_string_lossy()
1313
);
1414
}
15+
16+
#[cfg(target_os = "macos")]
17+
{
18+
let crate_name = std::env::var("CARGO_PKG_NAME").expect("CARGO_PKG_NAME not set");
19+
let lib_name = crate_name.replace('-', "_");
20+
println!(
21+
"cargo::rustc-link-arg=-Wl,-install_name,@rpath/lib{}.dylib",
22+
lib_name
23+
);
24+
}
1525
}

0 commit comments

Comments
 (0)