We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27e83c4 commit e9edb19Copy full SHA for e9edb19
build.rs
@@ -1,7 +1,16 @@
1
fn main() {
2
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" {
3
let mut res = winresource::WindowsResource::new();
4
- res.set_icon("logo.ico");
5
- res.compile().unwrap();
+ if std::path::Path::new("logo.ico").exists() {
+ 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();
15
}
16
0 commit comments