build.rs 514 B

12345678910
  1. //! Rebuild the crate when the build identity changes.
  2. //!
  3. //! `option_env!("SM121_VERSION")` is baked at compile time, but cargo does not
  4. //! treat an env var as an input on its own — without this line a cached build
  5. //! keeps the old value (the add-on's 1.3.6/1.3.7 images both shipped "dev"
  6. //! from a warm `target/` cache mount). `cargo:rerun-if-env-changed` makes the
  7. //! crate recompile whenever the version passed by the CI changes.
  8. fn main() {
  9. println!("cargo:rerun-if-env-changed=SM121_VERSION");
  10. }