summaryrefslogtreecommitdiff
path: root/plugins/workflow_swift/build.rs
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-09-04 14:40:53 -0700
committerMark Rowe <mark@vector35.com>2026-03-23 16:08:45 -0700
commita49c29b7aea694e41fb92b100325ce34affb413f (patch)
tree6fd2fc21dca5bf6c6191badbf0ec79712d10e045 /plugins/workflow_swift/build.rs
parentc62a7862a86c7a05732985a7759b66b0035fb356 (diff)
[Swift] Initial skeleton of a plug-in for Swift support
Diffstat (limited to 'plugins/workflow_swift/build.rs')
-rw-r--r--plugins/workflow_swift/build.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/workflow_swift/build.rs b/plugins/workflow_swift/build.rs
new file mode 100644
index 00000000..9006f16a
--- /dev/null
+++ b/plugins/workflow_swift/build.rs
@@ -0,0 +1,25 @@
+fn main() {
+ let link_path = std::env::var_os("DEP_BINARYNINJACORE_PATH")
+ .expect("DEP_BINARYNINJACORE_PATH not specified");
+
+ println!("cargo::rustc-link-lib=dylib=binaryninjacore");
+ println!("cargo::rustc-link-search={}", link_path.to_str().unwrap());
+
+ #[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
+ );
+ }
+}