feature. See also
. The project being documented here (as the example) is the Zig library itself.
Target.ObjectFormat
pub const ObjectFormat = enum
File
Code
pub const ObjectFormat = enum {
c,
coff,
elf,
hex,
macho,
plan9,
raw,
spirv,
wasm,
pub fn fileExt(of: ObjectFormat, arch: Cpu.Arch) [:0]const u8 {
return switch (of) {
.c => ".c",
.coff => ".obj",
.elf, .macho, .wasm => ".o",
.hex => ".ihex",
.plan9 => arch.plan9Ext(),
.raw => ".bin",
.spirv => ".spv",
};
}
pub fn default(os_tag: Os.Tag, arch: Cpu.Arch) ObjectFormat {
return switch (os_tag) {
.driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => .macho,
.plan9 => .plan9,
.uefi, .windows => .coff,
else => switch (arch) {
.spirv32, .spirv64 => .spirv,
.wasm32, .wasm64 => .wasm,
else => .elf,
},
};
}
}