From 4af71b4c0cc3877e8ba69788d4f51dc1681bdefd Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Sat, 5 Aug 2023 19:03:42 +0200 Subject: [PATCH] fix comment about wasm build --- build.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.zig b/build.zig index 32c3117..5da91a5 100644 --- a/build.zig +++ b/build.zig @@ -60,13 +60,17 @@ fn buildNative(b: *Build, target: CrossTarget, optimize: OptimizeMode, dep_sokol // - emcc must be used as linker instead of the zig linker to implement // the additional "Emscripten magic" (e.g. generating the .html and .js // file, setting up the web API shims, etc...) +// - an additional header search path into Emscripten's sysroot +// must be set so that the C code compiled with Zig finds the Emscripten +// sysroot headers (note: the build.zig in the sokol-zig bindings +// takes care of this when calling buildLibSokol() with a .wasm32 +// target and a sysroot) // - the Sokol C headers must be compiled as target wasm32-emscripten, otherwise // the EMSCRIPTEN_KEEPALIVE and EM_JS macro magic doesn't work +// (note: the build.zig in the sokol-zig bindings takes care of this +// special case when calling buildLibSokol() with any .wasm32 target) // - the Zig code must be compiled with target wasm32-freestanding // (see https://github.com/ziglang/zig/issues/10836) -// - an additional header search path into Emscripten's sysroot -// must be set so that the C code compiled with Zig finds the Emscripten -// sysroot headers // - the game code in pacman.zig is compiled into a library, and a // C file (src/emscripten/entry.c) is used as entry point, which then // calls an exported entry function "emsc_main()" in pacman.zig instead