Skip to content

Commit

Permalink
Add rerun-if cargo conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
coffinmatician committed Sep 15, 2023
1 parent 50e02c2 commit a4ebc6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fn main() {
let out_dir = PathBuf::from(env::var_os("OUT_DIR").expect("outdir"));
let config_dir = out_dir.join("include");
let vendor = root.join("vendor");
println!("cargo:rerun-if-changed={}", vendor.display());

// cc crate needs emscripten target to use correct `ar`
if env::var("TARGET").map_or(false, |t| t == "wasm32-unknown-unknown") {
Expand Down Expand Up @@ -81,6 +82,7 @@ fn main() {
#define JCOPYRIGHT_SHORT JCOPYRIGHT
", pkg_version = pkg_version)).expect("jversion");

println!("cargo:rerun-if-env-changed=SOURCE_DATE_EPOCH");
let timestamp: u64 = if let Ok(epoch) = env::var("SOURCE_DATE_EPOCH") {
u64::from_str(epoch.as_str()).expect("Invalid SOURCE_DATE_EPOCH environment variable")
} else {
Expand Down

0 comments on commit a4ebc6d

Please sign in to comment.