Open Ruulul opened 11 months ago
hmm, poking the repository, I see the master branch already changed the template to use executable (and with a better way to do it!), it is just not on the release version yet
@Ruulul No need for an entrypoint: https://github.com/aduros/wasm4/blob/091b829d548bd37c061b56300488154ad2df4272/cli/assets/templates/zig/build.zig#L14 (after the change to using addExecutable
)
As a small sidenote, I have two command line tools that I use to start projects for TIC-80 and Sokol Zig:
https://github.com/peterhellberg/sokol-init
Maybe I should also create something like that for WASM-4 :)
[!Note] I have used the new
build.zig
in a game jam submission :sparkles: and it worked out quite well.
I guess we could have a zig build run
command similar to what I have here: https://github.com/peterhellberg/tic-init/blob/f4a6aca706dc6734952635444067dc9251134d92/content/build.zig#L32-L48 🤔
in the process of poking your links and the build documentation, I learned so much more about the capacities of the zig build system
I replaced the invoke.zig
file with a simple snippet
https://github.com/Ruulul/wasm4evolution/blob/281176497e5ae7f23216ea80a9df6d1073828b02/build.zig#L23C1-L30C38
gonna soon publish this small simulator to wasm4, just need to adjust some things first
I just published my zig-wasm4-starter-kit which might interest you.
And I have a little tool myself over at https://github.com/peterhellberg/w4-init which I've so far used in a few small experiments ✨
Using master build 0.12.0-dev.1625+6fd1c64f2.
Currently, when you try to build with the template, it has issues, related to open issues with compiling as lib on wasm. Current workaround: add a dummy
export fn _start() void {}
and compile as executable.Ergonomics suggestion: it is possible to make zig itself call the
w4
, requiring a relatively small addition to the build and a new file:Opening as an issue first to know if I should just directly make a PR to the templates? It bothers me that one has to create the _start function, but I couldnt find a better workaround