Skip to content

Commit 4551d1f

Browse files
committed
Fix building rust tests in demo mode
1 parent 01a2244 commit 4551d1f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

plugins/pdb-ng/demo/build.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
fn main() {
2+
let link_path = std::env::var_os("DEP_BINARYNINJACORE_PATH")
3+
.expect("DEP_BINARYNINJACORE_PATH not specified");
4+
5+
println!("cargo::rustc-link-lib=dylib=binaryninjacore");
6+
println!("cargo::rustc-link-search={}", link_path.to_str().unwrap());
7+
8+
#[cfg(not(target_os = "windows"))]
9+
{
10+
println!(
11+
"cargo::rustc-link-arg=-Wl,-rpath,{0},-L{0}",
12+
link_path.to_string_lossy()
13+
);
14+
}
15+
}

rust/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,7 @@ pub fn set_license<S: BnStrCompatible + Default>(license: Option<S>) {
491491
}
492492

493493
#[cfg(feature = "demo")]
494-
pub fn set_license<S: BnStrCompatible + Default>(_license: Option<S>) {
495-
panic!("Cannot set license in demo mode!");
496-
}
494+
pub fn set_license<S: BnStrCompatible + Default>(_license: Option<S>) {}
497495

498496
pub fn product() -> BnString {
499497
unsafe { BnString::from_raw(BNGetProduct()) }

0 commit comments

Comments
 (0)