fn main() {
println!("cargo:rerun-if-changed=assets/icon.ico");
println!("cargo::rustc-check-cfg=cfg(engine)");
let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
if matches!(
(os.as_str(), arch.as_str()),
("macos", "aarch64") | ("windows", "x86_64") | ("linux", "x86_64" | "aarch64")
) {
println!("cargo::rustc-cfg=engine");
}
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
let mut res = winresource::WindowsResource::new();
res.set_icon("assets/icon.ico");
res.compile().expect("failed to embed Windows resources");
}
}