From 875948519f71739b5e50e9ec3f1e74f822a59441 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Tue, 25 Jan 2022 14:53:01 -0500 Subject: [PATCH] Add Windows icon --- Cargo.lock | 10 ++++++++++ Cargo.toml | 6 +++++- build.rs | 12 ++++++++++++ icon.ico | Bin 0 -> 4286 bytes icon.svg | 8 ++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 build.rs create mode 100644 icon.ico create mode 100644 icon.svg diff --git a/Cargo.lock b/Cargo.lock index f09c77d..b64c595 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1045,6 +1045,7 @@ dependencies = [ "specs", "specs-derive", "spin_sleep", + "winres", ] [[package]] @@ -2419,6 +2420,15 @@ dependencies = [ "x11-dl", ] +[[package]] +name = "winres" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +dependencies = [ + "toml", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index 6dcc274..9e6b5e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "kroz" version = "0.1.0" edition = "2021" +build = "build.rs" [dependencies] bracket-lib = { git = "https://github.com/amethyst/bracket-lib" } @@ -10,4 +11,7 @@ specs-derive = "0.4.1" cpal = "0.13" oddio = "0.5" rand = "0.8" -spin_sleep = "1.0" \ No newline at end of file +spin_sleep = "1.0" + +[target.'cfg(windows)'.build-dependencies] +winres = "0.1" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..b5eecd2 --- /dev/null +++ b/build.rs @@ -0,0 +1,12 @@ +#[cfg(windows)] +extern crate winres; + +#[cfg(windows)] +fn main() { + let mut res = winres::WindowsResource::new(); + res.set_icon("icon.ico"); + res.compile().unwrap(); +} + +#[cfg(unix)] +fn main() {} diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..90a89d967073e1bea277ffafa4600a2471f286fe GIT binary patch literal 4286 zcmeH~zfQtX6vhw!S&fFo+0lt-Fgyi=Z$W$nUx65%O4zHgd?N1`c7Y!+p^4S2%HVi%oruZf?Yx?NqljYffQv2c5ODmHSsHfpE^11w<{@hYZkzPt=r z()5|;kNm0u16*N>qi9rarxW-eAHyh~mzR7G@F~uy8Zf@ge{oS>KNzw2rExxY>-AO* zAG(#J{>S8hehwUyNzjzOhxp)E&QI{8@&4Ye+YQeX&xs5lG4&xP|HDJjM$gf_y`9%D zA35|vH8J`xtlQh5w_bNUI9N4&^n#q&{OToh%WM{U%$PR%&bj6v)x^**EOf1Fs)@P^a`36948OiV!kSLq&d=Shuk-rx5hEwfU*`K$)%RCxh3xu+drB`Dv+Iy_4E<%+ lANsCn9q`-hFY#;bSk?Md*HQKOSO0%h-S^+&Po~Z4wpV{9aSs3h literal 0 HcmV?d00001 diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..d7f206b --- /dev/null +++ b/icon.svg @@ -0,0 +1,8 @@ + + + + + + + +