Skip to content

Commit

Permalink
injecting the icon through a resource file, no extra deps
Browse files Browse the repository at this point in the history
  • Loading branch information
NewtonChutney committed Dec 25, 2023
1 parent d5e6749 commit 9aa49ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Binary file added contrib/helix-icon-windows.lib
Binary file not shown.
10 changes: 10 additions & 0 deletions helix-term/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@ fn main() {
build_grammars(Some(std::env::var("TARGET").unwrap()))
.expect("Failed to compile tree-sitter grammars");
}

// link icon to windows executable
if cfg!(target_os = "windows") {
// fetch manifest dir from env var set by Cargo:
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR should be set by Cargo");

// link against the helix-icon-windows library from contrib dir:
println!("cargo:rustc-link-search=native={}", manifest_dir.replace("helix-term", "contrib"));
println!("cargo:rustc-link-lib=dylib=helix-icon-windows");
}
}

0 comments on commit 9aa49ca

Please sign in to comment.