pub fn parseCpuArch(args: ParseOptions) ?Target.Cpu.Arch args: ParseOptions329
330
331
332
333
334
335
336
337
338pub fn parseCpuArch(args: ParseOptions) ?Target.Cpu.Arch {
var it = mem.splitScalar(u8, args.arch_os_abi, '-');
const arch_name = it.first();
const arch_is_native = mem.eql(u8, arch_name, "native");
if (arch_is_native) {
return builtin.cpu.arch;
} else {
return std.meta.stringToEnum(Target.Cpu.Arch, arch_name);
}
}
Similar to
parseexcept instead of fully parsing, it only determines the CPU architecture and returns it if it can be determined, and returnsnullotherwise. This is intended to be used if the API user of Query needs to learn the target CPU architecture in order to fully populateParseOptions.