diff --git a/bin/build.rs b/bin/build.rs index 071215f..3dc2d3a 100644 --- a/bin/build.rs +++ b/bin/build.rs @@ -1,7 +1,12 @@ fn main() { println!("cargo::rerun-if-changed=src/invoke.py"); - println!("cargo::rerun-if-changed=../lib/target/wasm32-wasi/release/core.wasm"); let out = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("core.wasm"); - std::fs::copy("../lib/target/wasm32-wasi/release/core.wasm", out).unwrap(); + if let Ok(path) = std::env::var("EXTISM_ENGINE_PATH") { + println!("cargo::rerun-if-changed={path}"); + std::fs::copy(path, out).unwrap(); + } else { + println!("cargo::rerun-if-changed=../lib/target/wasm32-wasi/release/core.wasm"); + std::fs::copy("../lib/target/wasm32-wasi/release/core.wasm", out).unwrap(); + } }