box2d icon indicating copy to clipboard operation
box2d copied to clipboard

introduce a build.zig for easier zig codebase intergration

Open Avokadoen opened this issue 4 months ago • 3 comments

It would be great if the repo included a build.zig so that you could easily call zig fetch --save git+https://github.com/erincatto/box2d

Currently there is a fork with a working zig 0.14.x build.zig. I also have PR on that fork which updates this to zig 0.15.x and rebases ontop of this repo's main.

For context if you are unaware of zig: https://ziglang.org/

Avokadoen avatar Sep 08 '25 15:09 Avokadoen

Raylib is an example of a c repo hosting a build.zig for convenience.

Avokadoen avatar Sep 08 '25 15:09 Avokadoen

Sorry for not searching the issue tracker before making this issue. I can see there is: https://github.com/erincatto/box2d/issues/908. The mentioned fork is actually that issues author. I have been testing it on windows. I have a friend that tested it on linux and it worked. I have not tested cross-compiling, but that should work OOB as well (this could in turn be utilized by C/C++ projects to get trivial cross compiling as well!). I can get this to work in your CI with a PR if you would be interested.

Avokadoen avatar Sep 08 '25 16:09 Avokadoen

Yeah, please provide a PR and/or example code for the GitHub action.

erincatto avatar Sep 12 '25 00:09 erincatto