windows: Add file icon to build targets

Former-commit-id: 2dae2e7818d86ddf9470afafd0404f0e7e021718
This commit is contained in:
Michel Heily 2020-02-12 22:18:58 +02:00
parent 32a20d2cbb
commit 84004ddb5c
3 changed files with 13 additions and 0 deletions

View file

@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["Michel Heily <michelheily@gmail.com>"] authors = ["Michel Heily <michelheily@gmail.com>"]
edition = "2018" edition = "2018"
default-run= "rba-sdl2" default-run= "rba-sdl2"
build = "src/build.rs"
[dependencies] [dependencies]
serde = {version = "1.0.104", features = ["derive"] } serde = {version = "1.0.104", features = ["derive"] }
@ -41,6 +42,9 @@ nom = {version = "5.0.0", optional = true}
name = "rba-sdl2" name = "rba-sdl2"
path = "src/plat/sdl2/main.rs" path = "src/plat/sdl2/main.rs"
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
[[bin]] [[bin]]
name = "rba-minifb" name = "rba-minifb"
path = "src/plat/minifb/main.rs" path = "src/plat/minifb/main.rs"

BIN
assets/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

9
src/build.rs Normal file
View file

@ -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() {}