build.zig: fix building raylib for emscripten

build.zig doesn't support the examples for the emscripten OS but it does
support the raylib library. However, the examples panic if emscripten
is configured which prevents it from building the library. I've replaced
this panic with a fail step to fix this.
This commit is contained in:
Jonathan Marler 2025-04-26 10:33:23 -06:00
parent 5c954c1f52
commit 8d03636132

View file

@ -504,7 +504,7 @@ fn addExamples(
raylib: *std.Build.Step.Compile, raylib: *std.Build.Step.Compile,
) !*std.Build.Step { ) !*std.Build.Step {
if (target.result.os.tag == .emscripten) { if (target.result.os.tag == .emscripten) {
@panic("Emscripten building via Zig unsupported"); return &b.addFail("Emscripten building via Zig unsupported").step;
} }
const all = b.step(module, "All " ++ module ++ " examples"); const all = b.step(module, "All " ++ module ++ " examples");