Skip to content

Commit

Permalink
change: add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
cangzhang committed Jun 28, 2023
1 parent ac31ead commit 8407953
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ tracing = "0.1.37"
tracing-subscriber = "0.3.17"
tracing-appender = "0.2.2"

[build-dependencies]
[target.'cfg(windows)'.build-dependencies]
embed-resource = "2.1"
winres = "0.1"
Binary file added assets/icon@2x_r.ico
Binary file not shown.
16 changes: 14 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#[cfg(windows)]
extern crate embed_resource;
#[cfg(windows)]
extern crate winres;

fn main() {
fn main() {
#[cfg(target_os = "windows")]
embed_resource::compile("champr-manifest.rc", embed_resource::NONE);
}

if std::env::var("PROFILE").unwrap() == "release" {
if cfg!(target_os = "windows") {
let mut res = winres::WindowsResource::new();
res.set_icon("assets/icon@2x_r.ico")
.set("InternalName", "CHAMPR.EXE");
res.compile().unwrap();
}
}
}

0 comments on commit 8407953

Please sign in to comment.