1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

clean up set_binary_metadata (#6811)

This commit is contained in:
Ryan Dahl 2020-07-22 13:19:37 -04:00 committed by GitHub
parent a28e153a12
commit 69706331a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,4 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
//
mod op_fetch_asset;
use deno_core::js_check;
@ -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,
@ -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> {
@ -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() {}