UNPKG

@napi-rs/cli

Version:
34 lines (33 loc) 2.69 kB
export type Platform = NodeJS.Platform | 'wasm' | 'wasi' | 'openharmony'; export declare const UNIVERSAL_TARGETS: { readonly 'universal-apple-darwin': readonly ["aarch64-apple-darwin", "x86_64-apple-darwin"]; }; export declare const AVAILABLE_TARGETS: readonly ["aarch64-apple-darwin", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", "aarch64-unknown-linux-ohos", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-linux-ohos", "x86_64-unknown-freebsd", "i686-pc-windows-msvc", "armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-musleabihf", "armv7-linux-androideabi", "universal-apple-darwin", "riscv64gc-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "wasm32-wasi-preview1-threads", "wasm32-wasip1-threads"]; export type TargetTriple = (typeof AVAILABLE_TARGETS)[number]; export declare const DEFAULT_TARGETS: readonly ["x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"]; export declare const TARGET_LINKER: Record<string, string>; type NodeJSArch = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 'riscv64' | 's390' | 's390x' | 'x32' | 'x64' | 'universal' | 'wasm32'; export declare const NodeArchToCpu: Record<string, string>; export declare const UniArchsByPlatform: Partial<Record<Platform, NodeJSArch[]>>; export interface Target { triple: string; platformArchABI: string; platform: Platform; arch: NodeJSArch; abi: string | null; } /** * A triple is a specific format for specifying a target architecture. * Triples may be referred to as a target triple which is the architecture for the artifact produced, and the host triple which is the architecture that the compiler is running on. * The general format of the triple is `<arch><sub>-<vendor>-<sys>-<abi>` where: * - `arch` = The base CPU architecture, for example `x86_64`, `i686`, `arm`, `thumb`, `mips`, etc. * - `sub` = The CPU sub-architecture, for example `arm` has `v7`, `v7s`, `v5te`, etc. * - `vendor` = The vendor, for example `unknown`, `apple`, `pc`, `nvidia`, etc. * - `sys` = The system name, for example `linux`, `windows`, `darwin`, etc. none is typically used for bare-metal without an OS. * - `abi` = The ABI, for example `gnu`, `android`, `eabi`, etc. */ export declare function parseTriple(rawTriple: string): Target; export declare function getSystemDefaultTarget(): Target; export declare function getTargetLinker(target: string): string | undefined; export declare function targetToEnvVar(target: string): string; export {};