Contains all the same data as Target, additionally introducing the concept of “the native target”. The purpose of this abstraction is to provide meaningful and unsurprising defaults. This struct does reference any resources and it is copyable.

Fields

cpu_arch: ?Target.Cpu.Arch = null,

null means native.

cpu_model: CpuModel = CpuModel.determined_by_cpu_arch,
cpu_features_add: Target.Cpu.Feature.Set = Target.Cpu.Feature.Set.empty,

Sparse set of CPU features to add to the set from cpu_model.

cpu_features_sub: Target.Cpu.Feature.Set = Target.Cpu.Feature.Set.empty,

Sparse set of CPU features to remove from the set from cpu_model.

os_tag: ?Target.Os.Tag = null,

null means native.

os_version_min: ?OsVersion = null,

null means the default version range for os_tag. If os_tag is null (native) then null for this field means native.

os_version_max: ?OsVersion = null,

When cross compiling, null means default (latest known OS version). When os_tag is native, null means equal to the native OS version.

glibc_version: ?SemanticVersion = null,

null means default when cross compiling, or native when os_tag is native. If isGnuLibC() is false, this must be null and is ignored.

abi: ?Target.Abi = null,

null means the native C ABI, if os_tag is native, otherwise it means the default C ABI.

dynamic_linker: DynamicLinker = .{ },

When os_tag is null, then null means native. Otherwise it means the standard path based on the os_tag.

ofmt: ?Target.ObjectFormat = null,

null means default for the cpu/arch/os combo.

Functions

fn allocDescription(self: CrossTarget, allocator: mem.Allocator) ![]u8

No documentation provided.

fn dynamicLibSuffix(self: CrossTarget) [:0]const u8

No documentation provided.

fn exeFileExt(self: CrossTarget) [:0]const u8

No documentation provided.

fn fromTarget(target: Target) CrossTarget

No documentation provided.

fn getCpuArch(self: CrossTarget) Target.Cpu.Arch

No documentation provided.

fn getCpuFeatures(self: CrossTarget) Target.Cpu.Feature.Set

No documentation provided.

fn getCpuModel(self: CrossTarget) *const Target.Cpu.Model

No documentation provided.

fn getObjectFormat(self: CrossTarget) Target.ObjectFormat

No documentation provided.

fn getOsTag(self: CrossTarget) Target.Os.Tag

No documentation provided.

fn isDarwin(self: CrossTarget) bool

No documentation provided.

fn isDragonFlyBSD(self: CrossTarget) bool

No documentation provided.

fn isFreeBSD(self: CrossTarget) bool

No documentation provided.

fn isGnuLibC(self: CrossTarget) bool

No documentation provided.

fn isLinux(self: CrossTarget) bool

No documentation provided.

fn isNative(self: CrossTarget) bool

No documentation provided.

fn isNativeAbi(self: CrossTarget) bool

No documentation provided.

fn isNativeCpu(self: CrossTarget) bool

No documentation provided.

fn isNativeOs(self: CrossTarget) bool

No documentation provided.

fn isNetBSD(self: CrossTarget) bool

No documentation provided.

fn isOpenBSD(self: CrossTarget) bool

No documentation provided.

fn isUefi(self: CrossTarget) bool

No documentation provided.

fn isWindows(self: CrossTarget) bool

No documentation provided.

fn libPrefix(self: CrossTarget) [:0]const u8

No documentation provided.

fn linuxTriple(self: CrossTarget, allocator: mem.Allocator) ![]u8

No documentation provided.

fn parse(args: ParseOptions) !CrossTarget

No documentation provided.

fn parseCpuArch(args: ParseOptions) ?Target.Cpu.Arch

Similar to parse except instead of fully parsing, it only determines the CPU …

Similar to parse except instead of fully parsing, it only determines the CPU architecture and returns it if it can be determined, and returns null otherwise. This is intended to be used if the API user of CrossTarget needs to learn the target CPU architecture in order to fully populate ParseOptions.

fn setGnuLibCVersion(self: *CrossTarget, major: u32, minor: u32, patch: u32) void

No documentation provided.

fn staticLibSuffix(self: CrossTarget) [:0]const u8

No documentation provided.

fn updateCpuFeatures(self: CrossTarget, set: *Target.Cpu.Feature.Set) void

No documentation provided.

fn vcpkgTriplet(self: CrossTarget, allocator: mem.Allocator, linkage: VcpkgLinkage) ![]u8

Returned slice must be freed by the caller.

fn wantSharedLibSymLinks(self: CrossTarget) bool

No documentation provided.

fn zigTriple(self: CrossTarget, allocator: mem.Allocator) error{OutOfMemory}![]u8

No documentation provided.