authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-20 12:24:33-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:36-07:00
log88ae1d9aeca6441f2c905bbde61d399025c63242
tree01554231f30b01804c46b0dd384c36a8ba2841c9
parentd1204d410472786bfd831a6349437b7784273f42

Configuration: fix the target os enum mismatch


1 files changed, 93 insertions(+), 5 deletions(-)

lib/std/Build/Configuration.zig+93-5
......@@ -2324,6 +2324,7 @@ pub const TargetQuery = struct {
23242324 ps3,
23252325 ps4,
23262326 ps5,
2327 psp,
23272328 vita,
23282329 emscripten,
23292330 wasi,
......@@ -2335,18 +2336,105 @@ pub const TargetQuery = struct {
23352336 opencl,
23362337 opengl,
23372338 vulkan,
2339 tios,
23382340
23392341 default,
23402342
23412343 pub fn init(x: ?std.Target.Os.Tag) @This() {
2342 // TODO comptime assert the enums match
2343 return @enumFromInt(@intFromEnum(x orelse return .default));
2344 return switch (x orelse return .default) {
2345 .freestanding => .freestanding,
2346 .other => .other,
2347 .contiki => .contiki,
2348 .fuchsia => .fuchsia,
2349 .hermit => .hermit,
2350 .managarm => .managarm,
2351 .haiku => .haiku,
2352 .hurd => .hurd,
2353 .illumos => .illumos,
2354 .linux => .linux,
2355 .plan9 => .plan9,
2356 .rtems => .rtems,
2357 .serenity => .serenity,
2358 .dragonfly => .dragonfly,
2359 .freebsd => .freebsd,
2360 .netbsd => .netbsd,
2361 .openbsd => .openbsd,
2362 .driverkit => .driverkit,
2363 .ios => .ios,
2364 .maccatalyst => .maccatalyst,
2365 .macos => .macos,
2366 .tvos => .tvos,
2367 .visionos => .visionos,
2368 .watchos => .watchos,
2369 .windows => .windows,
2370 .uefi => .uefi,
2371 .@"3ds" => .@"3ds",
2372 .ps3 => .ps3,
2373 .ps4 => .ps4,
2374 .ps5 => .ps5,
2375 .psp => .psp,
2376 .vita => .vita,
2377 .emscripten => .emscripten,
2378 .wasi => .wasi,
2379 .amdhsa => .amdhsa,
2380 .amdpal => .amdpal,
2381 .cuda => .cuda,
2382 .mesa3d => .mesa3d,
2383 .nvcl => .nvcl,
2384 .opencl => .opencl,
2385 .opengl => .opengl,
2386 .vulkan => .vulkan,
2387 .tios => .tios,
2388 };
23442389 }
23452390
23462391 pub fn unwrap(this: @This()) ?std.Target.Os.Tag {
2347 // TODO comptime assert the enums match
2348 if (this == .default) return null;
2349 return @enumFromInt(@intFromEnum(this));
2392 return switch (this) {
2393 .default => null,
2394 .freestanding => .freestanding,
2395 .other => .other,
2396 .contiki => .contiki,
2397 .fuchsia => .fuchsia,
2398 .hermit => .hermit,
2399 .managarm => .managarm,
2400 .haiku => .haiku,
2401 .hurd => .hurd,
2402 .illumos => .illumos,
2403 .linux => .linux,
2404 .plan9 => .plan9,
2405 .rtems => .rtems,
2406 .serenity => .serenity,
2407 .dragonfly => .dragonfly,
2408 .freebsd => .freebsd,
2409 .netbsd => .netbsd,
2410 .openbsd => .openbsd,
2411 .driverkit => .driverkit,
2412 .ios => .ios,
2413 .maccatalyst => .maccatalyst,
2414 .macos => .macos,
2415 .tvos => .tvos,
2416 .visionos => .visionos,
2417 .watchos => .watchos,
2418 .windows => .windows,
2419 .uefi => .uefi,
2420 .@"3ds" => .@"3ds",
2421 .ps3 => .ps3,
2422 .ps4 => .ps4,
2423 .ps5 => .ps5,
2424 .psp => .psp,
2425 .vita => .vita,
2426 .emscripten => .emscripten,
2427 .wasi => .wasi,
2428 .amdhsa => .amdhsa,
2429 .amdpal => .amdpal,
2430 .cuda => .cuda,
2431 .mesa3d => .mesa3d,
2432 .nvcl => .nvcl,
2433 .opencl => .opencl,
2434 .opengl => .opengl,
2435 .vulkan => .vulkan,
2436 .tios => .tios,
2437 };
23502438 }
23512439 };
23522440 pub const ObjectFormat = enum(u4) {