From d1a7f8073decd0251e78cea6163c0eec24e0815e Mon Sep 17 00:00:00 2001 From: Connor Rowland Date: Sat, 14 Dec 2024 16:25:15 -0800 Subject: [PATCH] Emscripten needs its own libc (#2) --- build.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 87372e2..b12a124 100644 --- a/build.zig +++ b/build.zig @@ -34,7 +34,14 @@ pub fn build(b: *std.Build) void { }, }); } - zstbi_lib.linkLibC(); + + if (target.result.os.tag == .emscripten) { + zstbi_lib.addIncludePath(.{ + .cwd_relative = b.pathJoin(&.{ b.sysroot.?, "/include" }), + }); + } else { + zstbi_lib.linkLibC(); + } b.installArtifact(zstbi_lib); const test_step = b.step("test", "Run zstbi tests");