From d69e158b41629e5a8d3a14c4e92a09a843422a6c Mon Sep 17 00:00:00 2001 From: Alula <6276139+alula@users.noreply.github.com> Date: Tue, 22 Mar 2022 05:26:38 +0100 Subject: [PATCH] switch to winres crate --- Cargo.toml | 2 +- build.rs | 8 ++++++-- res/resources.rc | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 res/resources.rc diff --git a/Cargo.toml b/Cargo.toml index 8d60f5a..273618c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,7 @@ xmltree = "0.10.3" winapi = { version = "0.3", features = ["winuser"] } [target.'cfg(target_os = "windows")'.build-dependencies] -windres = "0.2" +winres = "0.1" [target.'cfg(target_os = "macos")'.dependencies] objc = "0.2.7" diff --git a/build.rs b/build.rs index 590271f..48ac551 100644 --- a/build.rs +++ b/build.rs @@ -1,7 +1,7 @@ use std::env; #[cfg(target_os = "windows")] -extern crate windres; +extern crate winres; fn main() { // let dest = PathBuf::from(&env::var("OUT_DIR").unwrap()); @@ -11,7 +11,11 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); #[cfg(target_os = "windows")] - windres::Build::new().compile("res/resources.rc").unwrap(); + { + let mut res = winres::WindowsResource::new(); + res.set_icon("res/sue.ico"); + res.compile().unwrap(); + } if target.contains("darwin") { println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15"); diff --git a/res/resources.rc b/res/resources.rc deleted file mode 100644 index 11240fc..0000000 --- a/res/resources.rc +++ /dev/null @@ -1 +0,0 @@ -0 ICON "sue.ico"