Skip to content

Commit

Permalink
added icon for Windows exe file
Browse files Browse the repository at this point in the history
  • Loading branch information
NewtonChutney committed Dec 17, 2023
1 parent c56cd6e commit 81c0985
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
29 changes: 24 additions & 5 deletions Cargo.lock

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

Binary file added contrib/helix-256p.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions helix-term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ crossterm = { version = "0.27", features = ["event-stream", "use-dev-tty"] }
[build-dependencies]
helix-loader = { path = "../helix-loader" }

[target.'cfg(windows)'.build-dependencies]
# winres to inject icon into Windows binary
winres = "0.1.12"

[dev-dependencies]
smallvec = "1.11"
indoc = "2.0.4"
Expand Down
6 changes: 6 additions & 0 deletions helix-term/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
use helix_loader::grammar::{build_grammars, fetch_grammars};
extern crate winres;

fn main() {
if std::env::var("HELIX_DISABLE_AUTO_GRAMMAR_BUILD").is_err() {
fetch_grammars().expect("Failed to fetch tree-sitter grammars");
build_grammars(Some(std::env::var("TARGET").unwrap()))
.expect("Failed to compile tree-sitter grammars");
}
if cfg!(target_os = "windows") {
let mut res = winres::WindowsResource::new();
res.set_icon("../contrib/helix-256p.ico");
res.compile().unwrap();
}
}

0 comments on commit 81c0985

Please sign in to comment.