Skip to content

Commit

Permalink
fix some minor build.rs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
addisoncrump committed Jan 3, 2023
1 parent 55c8e0b commit 7a7f78d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
fn main() {
println!("cargo:rerun-if-env-changed=CUSTOM_LIBFUZZER_PATH");
if let Ok(custom) = ::std::env::var("CUSTOM_LIBFUZZER_PATH") {
let custom_lib_path = ::std::path::PathBuf::from(&custom);
let custom_lib_dir = custom_lib_path.parent().unwrap().to_string_lossy();

let custom_lib_name = custom_lib_path.file_stem().unwrap().to_string_lossy();
let custom_lib_name = custom_lib_name.trim_start_matches("lib");
let custom_lib_name = custom_lib_name.strip_prefix("lib").unwrap_or(custom_lib_name.as_ref());

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

0 comments on commit 7a7f78d

Please sign in to comment.