Skip to content

Commit e9edb19

Browse files
authored
apply suggestions
1 parent 27e83c4 commit e9edb19

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
fn main() {
22
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" {
33
let mut res = winresource::WindowsResource::new();
4-
res.set_icon("logo.ico");
5-
res.compile().unwrap();
4+
if std::path::Path::new("logo.ico").exists() {
5+
res.set_icon("logo.ico");
6+
} else {
7+
println!("cargo:warning=logo.ico not found, skipping icon embedding");
8+
return;
9+
}
10+
res.compile()
11+
.map_err(|e| {
12+
println!("cargo:warning=Failed to compile Windows resources: {}", e);
13+
})
14+
.ok();
615
}
716
}

0 commit comments

Comments
 (0)