2023-01-02 16:00:42 -05:00
|
|
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
2020-07-19 13:49:44 -04:00
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
const primordials = globalThis.__bootstrap.primordials;
|
|
|
|
const { ObjectFreeze, StringPrototypeSplit } = primordials;
|
2021-07-03 10:58:08 -04:00
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
const build = {
|
|
|
|
target: "unknown",
|
|
|
|
arch: "unknown",
|
|
|
|
os: "unknown",
|
|
|
|
vendor: "unknown",
|
|
|
|
env: undefined,
|
|
|
|
};
|
2020-07-19 13:49:44 -04:00
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
function setBuildInfo(target) {
|
|
|
|
const { 0: arch, 1: vendor, 2: os, 3: env } = StringPrototypeSplit(
|
|
|
|
target,
|
|
|
|
"-",
|
|
|
|
4,
|
|
|
|
);
|
|
|
|
build.target = target;
|
|
|
|
build.arch = arch;
|
|
|
|
build.vendor = vendor;
|
|
|
|
build.os = os;
|
|
|
|
build.env = env;
|
|
|
|
ObjectFreeze(build);
|
|
|
|
}
|
2020-07-19 13:49:44 -04:00
|
|
|
|
2023-02-07 14:22:46 -05:00
|
|
|
export { build, setBuildInfo };
|