fn main() {
// Leak detection does bookkeeping on every entity handle, so `test-support`
// does not enable it: that feature must stay cheap enough to compile into
// every build. CI or a local build can set `GPUI_LEAK_DETECTION`; the
// `leak-detection` feature turns it on explicitly.
println!("cargo::rustc-check-cfg=cfg(gpui_leak_detection)");
println!("cargo::rerun-if-env-changed=GPUI_LEAK_DETECTION");
let requested_by_environment =
std::env::var_os("GPUI_LEAK_DETECTION").is_some_and(|value| !value.is_empty());
if requested_by_environment || std::env::var_os("CARGO_FEATURE_LEAK_DETECTION").is_some() {
println!("cargo::rustc-cfg=gpui_leak_detection");
}
}