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 0000000..90a89d9 Binary files /dev/null and b/icon.ico differ diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..d7f206b --- /dev/null +++ b/icon.svg @@ -0,0 +1,8 @@ + + + + + + + +