use std::path::PathBuf;

fn main() {
	let icon_png = PathBuf::from("resources/ChatGPT Image 4 lug 2026, 18_12_31.png");
	let icon_ico = PathBuf::from("resources/query-forge.ico");
	println!("cargo:rerun-if-changed={}", icon_png.display());
	println!("cargo:rerun-if-changed={}", icon_ico.display());

	if std::env::var("CARGO_CFG_TARGET_OS").ok().as_deref() != Some("windows") {
		return;
	}

	let mut resources = winres::WindowsResource::new();
	resources.set_icon(icon_ico.to_str().expect("icon path is not valid UTF-8"));
	resources
		.compile()
		.expect("failed to compile Windows resources");
}