diff options
author | Maayan Hanin <maayan.asa.hanin@gmail.com> | 2020-07-15 22:54:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 21:54:38 +0200 |
commit | b0f2bd4a2d1a75d7c8e4643a4b5b9478c1935668 (patch) | |
tree | a357ee063d9b2baf7749deb5c61e924843fee5b4 /cli/build.rs | |
parent | 73a90360894267c69365d97f535a3573861e4ace (diff) |
fix(cli): add icon and metadata to deno.exe on Windows (#6693)
Co-authored-by: Mark Tiedemann <www.marktiedemann@gmail.com>
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Diffstat (limited to 'cli/build.rs')
-rw-r--r-- | cli/build.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/build.rs b/cli/build.rs index 5cf4b02e2..5d343c5f3 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -6,6 +6,11 @@ use std::collections::HashMap; use std::env; use std::path::PathBuf; +#[cfg(target_os = "windows")] +extern crate winapi; +#[cfg(target_os = "windows")] +extern crate winres; + fn main() { // Don't build V8 if "cargo doc" is being run. This is to support docs.rs. if env::var_os("RUSTDOCFLAGS").is_some() { @@ -111,4 +116,20 @@ fn main() { &main_module_name, ) .expect("Failed to create snapshot"); + + set_binary_metadata(); } + +#[cfg(target_os = "windows")] +fn set_binary_metadata() { + let mut res = winres::WindowsResource::new(); + res.set_icon("deno.ico"); + res.set_language(winapi::um::winnt::MAKELANGID( + winapi::um::winnt::LANG_ENGLISH, + winapi::um::winnt::SUBLANG_ENGLISH_US, + )); + res.compile().unwrap(); +} + +#[cfg(not(target_os = "windows"))] +fn set_binary_metadata() {} |