use std::error::Error;
use std::path::Path;
fn main() -> Result<(), Box<dyn Error>> {
println!("cargo::rustc-check-cfg=cfg(servo_production)");
println!("cargo::rustc-check-cfg=cfg(servo_do_not_use_in_production)");
let out = std::env::var("OUT_DIR")?;
let out = Path::new(&out);
let krate = out.parent().unwrap();
let build = krate.parent().unwrap();
let profile = build
.parent()
.unwrap()
.file_name()
.unwrap()
.to_string_lossy();
if profile == "production" || profile.starts_with("production-") {
println!("cargo:rustc-cfg=servo_production");
} else {
println!("cargo:rustc-cfg=servo_do_not_use_in_production");
}
Ok(())
}