Skip to content

Commit a184a2a

Browse files
committed
[bntl] Fix rpaths to not include an absolute path into the build directory on macOS
1 parent 15996cf commit a184a2a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

plugins/bntl_utils/build.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ fn main() {
77
println!("cargo::rustc-link-lib=dylib=binaryninjacore");
88
println!("cargo::rustc-link-search={}", link_path.to_str().unwrap());
99

10-
#[cfg(not(target_os = "windows"))]
10+
#[cfg(target_os = "linux")]
1111
{
1212
println!(
1313
"cargo::rustc-link-arg=-Wl,-rpath,{0},-L{0}",
1414
link_path.to_string_lossy()
1515
);
1616
}
1717

18-
// #[cfg(target_os = "macos")]
19-
// {
20-
// let crate_name = std::env::var("CARGO_PKG_NAME").expect("CARGO_PKG_NAME not set");
21-
// let lib_name = crate_name.replace('-', "_");
22-
// println!(
23-
// "cargo::rustc-link-arg=-Wl,-install_name,@rpath/lib{}.dylib",
24-
// lib_name
25-
// );
26-
// }
18+
#[cfg(target_os = "macos")]
19+
{
20+
let crate_name = std::env::var("CARGO_PKG_NAME").expect("CARGO_PKG_NAME not set");
21+
let lib_name = crate_name.replace('-', "_");
22+
println!(
23+
"cargo::rustc-link-arg=-Wl,-install_name,@rpath/lib{}.dylib",
24+
lib_name
25+
);
26+
}
2727

2828
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR specified");
2929
let out_dir_path = PathBuf::from(out_dir);

0 commit comments

Comments
 (0)