Re-run build.rs if env vars change (#694)

master
Bernhard Schuster 2 years ago committed by GitHub
parent e78c9e8879
commit 83eea97024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      librocksdb-sys/build.rs

@ -288,12 +288,16 @@ fn build_snappy() {
}
fn try_to_find_and_link_lib(lib_name: &str) -> bool {
println!("cargo:rerun-if-env-changed={}_COMPILE", lib_name);
if let Ok(v) = env::var(&format!("{}_COMPILE", lib_name)) {
if v.to_lowercase() == "true" || v == "1" {
return false;
}
}
println!("cargo:rerun-if-env-changed={}_LIB_DIR", lib_name);
println!("cargo:rerun-if-env-changed={}_STATIC", lib_name);
if let Ok(lib_dir) = env::var(&format!("{}_LIB_DIR", lib_name)) {
println!("cargo:rustc-link-search=native={}", lib_dir);
let mode = match env::var_os(&format!("{}_STATIC", lib_name)) {

Loading…
Cancel
Save