Skip to content

Commit 289f20f

Browse files
authored
Merge pull request #103 from VTCAKAVSMoACE/main
Fix minor build.rs issues w.r.t. custom libfuzzer paths
2 parents 55c8e0b + 663c0b6 commit 289f20f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
fn main() {
2+
println!("cargo:rerun-if-env-changed=CUSTOM_LIBFUZZER_PATH");
23
if let Ok(custom) = ::std::env::var("CUSTOM_LIBFUZZER_PATH") {
4+
println!("cargo:rerun-if-changed={custom}");
5+
36
let custom_lib_path = ::std::path::PathBuf::from(&custom);
47
let custom_lib_dir = custom_lib_path.parent().unwrap().to_string_lossy();
58

69
let custom_lib_name = custom_lib_path.file_stem().unwrap().to_string_lossy();
7-
let custom_lib_name = custom_lib_name.trim_start_matches("lib");
10+
let custom_lib_name = custom_lib_name
11+
.strip_prefix("lib")
12+
.unwrap_or(custom_lib_name.as_ref());
813

914
println!("cargo:rustc-link-search=native={}", custom_lib_dir);
1015
println!("cargo:rustc-link-lib=static={}", custom_lib_name);

0 commit comments

Comments
 (0)