Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/unwinder/build.rs
1690 views
1
fn main() {
2
// NB: duplicating a workaround in the wasmtime-fiber build script.
3
custom_cfg("asan", cfg_is("sanitize", "address"));
4
}
5
6
fn cfg_is(key: &str, val: &str) -> bool {
7
std::env::var(&format!("CARGO_CFG_{}", key.to_uppercase()))
8
.ok()
9
.as_deref()
10
== Some(val)
11
}
12
13
fn custom_cfg(key: &str, enabled: bool) {
14
println!("cargo:rustc-check-cfg=cfg({key})");
15
if enabled {
16
println!("cargo:rustc-cfg={key}");
17
}
18
}
19
20