Skip to content

Commit

Permalink
clean up set_binary_metadata (denoland#6811)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jul 22, 2020
1 parent a28e153 commit 6970633
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
//
mod op_fetch_asset;

use deno_core::js_check;
Expand All @@ -10,11 +9,6 @@ use std::env;
use std::path::Path;
use std::path::PathBuf;

#[cfg(target_os = "windows")]
extern crate winapi;
#[cfg(target_os = "windows")]
extern crate winres;

fn create_snapshot(
mut isolate: CoreIsolate,
snapshot_path: &Path,
Expand Down Expand Up @@ -105,7 +99,16 @@ fn main() {
let js_files = get_js_files("tsc");
create_compiler_snapshot(&compiler_snapshot_path, js_files, &c);

set_binary_metadata();
#[cfg(target_os = "windows")]
{
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();
}
}

fn get_js_files(d: &str) -> Vec<String> {
Expand All @@ -120,17 +123,3 @@ fn get_js_files(d: &str) -> Vec<String> {
js_files.sort();
js_files
}

#[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() {}

0 comments on commit 6970633

Please sign in to comment.