BREAKING: Use LLVM target triple for Deno.build (#4948)

Deno.build.os values have changed to correspond to standard LLVM target triples
"win" -> "windows"
"mac" -> "darwin"
This commit is contained in:
Ryan Dahl 2020-04-28 12:35:23 -04:00 committed by GitHub
parent f7ab19b1b7
commit e0ca60e770
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 165 additions and 188 deletions

View file

@ -1,24 +1,19 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
export type OperatingSystem = "mac" | "win" | "linux";
export type Arch = "x64" | "arm64";
// Do not add unsupported platforms.
export interface BuildInfo {
arch: Arch;
os: OperatingSystem;
}
export const build: BuildInfo = {
arch: "" as Arch,
os: "" as OperatingSystem,
export const build = {
target: "unknown",
arch: "unknown",
os: "unknown",
vendor: "unknown",
env: undefined as string | undefined,
};
export function setBuildInfo(os: OperatingSystem, arch: Arch): void {
build.os = os;
export function setBuildInfo(target: string): void {
const [arch, vendor, os, env] = target.split("-", 4);
build.target = target;
build.arch = arch;
build.vendor = vendor;
build.os = os;
build.env = env;
Object.freeze(build);
}