Skip to content

Commit

Permalink
Add icon and metadata to Windows output exe
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawdl3y committed Apr 11, 2023
1 parent 3be24e0 commit b34d448
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
name = "heartsock-server"
version = "0.1.0"
edition = "2021"
build = "build.rs"

[features]
default = ["mdns-sd"]
mdns-sd = ["dep:mdns-sd"]
simple-mdns = ["dep:simple-mdns"]

[package.metadata.winres]
FileDescription = "Heartsock relay server for integration with the watch app and games/applications"
ProductName = "Heartsock Server"

[dependencies]
async-trait = "0.1"
tracing = "0.1"
Expand All @@ -22,6 +27,9 @@ mdns-sd = { version = "0.7", optional = true }
simple-mdns = { version = "0.4", features = ["async-tokio"], optional = true }
cfg-if = "1"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

[profile.release]
lto = "thin"
codegen-units = 1
14 changes: 14 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#[cfg(windows)]
extern crate winres;

#[cfg(windows)]
fn main() {
let mut res = winres::WindowsResource::new();
res.set_icon("windows-icon.ico");
res.compile().unwrap();
}

#[cfg(unix)]
fn main() {
// Nothing special to do here for the time being
}
Binary file added windows-icon.ico
Binary file not shown.

0 comments on commit b34d448

Please sign in to comment.