forked from FaveTeamz/workload-governor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
14 lines (13 loc) · 706 Bytes
/
Copy pathbuild.rs
File metadata and controls
14 lines (13 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::path::Path;
fn main() {
// Enable the `wasm_available` cfg when the release WASM has been built.
// This lets upgrade tests that use include_bytes! compile only when the
// artifact exists (local dev + CI after `cargo build --target wasm32v1-none`).
// cargo-mutants works in a scratch directory without the WASM, so the flag
// will be absent and the upgrade tests are skipped — keeping the baseline green.
let wasm_path = Path::new("target/wasm32v1-none/release/workload_governor.wasm");
if wasm_path.exists() {
println!("cargo:rustc-cfg=wasm_available");
}
println!("cargo:rerun-if-changed=target/wasm32v1-none/release/workload_governor.wasm");
}