Skip to content

Commit 7a7f78d

Browse files
committed
fix some minor build.rs issues
1 parent 55c8e0b commit 7a7f78d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.rs

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

67
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");
8+
let custom_lib_name = custom_lib_name.strip_prefix("lib").unwrap_or(custom_lib_name.as_ref());
89

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

0 commit comments

Comments
 (0)