18 lines
485 B
Rust
18 lines
485 B
Rust
fn main() {
|
|
println!("cargo:rerun-if-env-changed=LOCAL");
|
|
println!("cargo:rustc-check-cfg=cfg(local)");
|
|
|
|
let local_env = std::env::var("LOCAL")
|
|
.map(|v| {
|
|
let v = v.trim().to_ascii_lowercase();
|
|
matches!(v.as_str(), "true" | "1" | "yes" | "on")
|
|
})
|
|
.unwrap_or(false);
|
|
|
|
let local_feature = std::env::var("CARGO_FEATURE_LOCAL").is_ok();
|
|
|
|
if local_env || local_feature {
|
|
println!("cargo:rustc-cfg=local");
|
|
}
|
|
}
|