diff --git a/Cargo.toml b/Cargo.toml index afc92ae..79bd991 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors = ["Michel Heily "] edition = "2018" default-run= "rba-sdl2" +build = "src/build.rs" [dependencies] serde = {version = "1.0.104", features = ["derive"] } @@ -41,6 +42,9 @@ nom = {version = "5.0.0", optional = true} name = "rba-sdl2" path = "src/plat/sdl2/main.rs" +[target.'cfg(windows)'.build-dependencies] +winres = "0.1" + [[bin]] name = "rba-minifb" path = "src/plat/minifb/main.rs" diff --git a/assets/icon.ico b/assets/icon.ico new file mode 100644 index 0000000..9cabd8c Binary files /dev/null and b/assets/icon.ico differ diff --git a/src/build.rs b/src/build.rs new file mode 100644 index 0000000..cfa9215 --- /dev/null +++ b/src/build.rs @@ -0,0 +1,9 @@ +#[cfg(windows)] +fn main() { + let mut res = winres::WindowsResource::new(); + res.set_icon("assets/icon.ico"); + res.compile().unwrap(); +} + +#[cfg(unix)] +fn main() {}