const ENV_CARGO_CFG_TARGET_ARCH: &str = "CARGO_CFG_TARGET_ARCH";
const ENV_CARGO_CFG_TARGET_OS: &str = "CARGO_CFG_TARGET_OS";
const ENV_CARGO_CFG_TARGET_ENV: &str = "CARGO_CFG_TARGET_ENV";
const ENV_CARGO_FEATURE_WASI_HTTP: &str = "CARGO_FEATURE_WASI_HTTP";
fn main() {
println!("cargo::rustc-check-cfg=cfg(native)");
println!("cargo::rustc-check-cfg=cfg(wasi_http)");
println!("cargo::rerun-if-changed=build.rs");
let target_arch = std::env::var(ENV_CARGO_CFG_TARGET_ARCH).unwrap_or_default();
let target_os = std::env::var(ENV_CARGO_CFG_TARGET_OS).unwrap_or_default();
let target_env = std::env::var(ENV_CARGO_CFG_TARGET_ENV).unwrap_or_default();
let wasi_http_feature = std::env::var(ENV_CARGO_FEATURE_WASI_HTTP).is_ok();
if target_arch != "wasm32" {
println!("cargo::rustc-cfg=native");
}
if target_arch == "wasm32" && target_os == "wasi" && target_env == "p2" && wasi_http_feature {
println!("cargo::rustc-cfg=wasi_http");
}
}