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
Sparse set of CPU features to add to the set from cpu_model
.
Sparse set of CPU features to remove from the set from cpu_model
.
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.
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 getOsVersionMax(self: CrossTarget) OsVersion
TODO deprecated, use
std.zig.system.NativeTargetInfo.detect
.fn getOsVersionMin(self: CrossTarget) OsVersion
TODO deprecated, use
std.zig.system.NativeTargetInfo.detect
.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 returnsnull
otherwise. This is intended to be used if the API user of CrossTarget needs to learn the target CPU architecture in order to fully populateParseOptions
.fn setGnuLibCVersion(self: *CrossTarget, major: u32, minor: u32, patch: u32) void
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 zigTriple(self: CrossTarget, allocator: mem.Allocator) error{OutOfMemory}![]u8
No documentation provided.