From 4551d1f3f4c99d72437d5908fe2aaa0ac850bb1f Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 27 Jan 2025 19:04:59 -0500 Subject: Fix building rust tests in demo mode --- plugins/pdb-ng/demo/build.rs | 15 +++++++++++++++ rust/src/lib.rs | 4 +--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 plugins/pdb-ng/demo/build.rs diff --git a/plugins/pdb-ng/demo/build.rs b/plugins/pdb-ng/demo/build.rs new file mode 100644 index 00000000..ed6cec7d --- /dev/null +++ b/plugins/pdb-ng/demo/build.rs @@ -0,0 +1,15 @@ +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(not(target_os = "windows"))] + { + println!( + "cargo::rustc-link-arg=-Wl,-rpath,{0},-L{0}", + link_path.to_string_lossy() + ); + } +} diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 267cf840..eb89ff0c 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -491,9 +491,7 @@ pub fn set_license(license: Option) { } #[cfg(feature = "demo")] -pub fn set_license(_license: Option) { - panic!("Cannot set license in demo mode!"); -} +pub fn set_license(_license: Option) {} pub fn product() -> BnString { unsafe { BnString::from_raw(BNGetProduct()) } -- cgit v1.3.1