()
| 1 | fn main() { |
| 2 | if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" { |
| 3 | println!("cargo:rerun-if-changed=logo.ico"); |
| 4 | let mut res = winresource::WindowsResource::new(); |
| 5 | if std::path::Path::new("logo.ico").exists() { |
| 6 | res.set_icon("logo.ico"); |
| 7 | } else { |
| 8 | println!("cargo:warning=logo.ico not found, skipping icon embedding"); |
| 9 | return; |
| 10 | } |
| 11 | res.compile() |
| 12 | .map_err(|e| { |
| 13 | println!("cargo:warning=Failed to compile Windows resources: {e}"); |
| 14 | }) |
| 15 | .ok(); |
| 16 | } |
| 17 | } |