I recently discovered that raylib provides a build.zig which allows to build that C project using Zig’s built-in C compiler. I then wanted to take this as an opportunity to explore this a little further and thereby gain a better understanding of it.
So my plan is to write a small C++ application with raylib as the only dependency. But for the first time not using CMake and g++ but Zig (current master aka 0.14.X) as the build system and compiler.
So I set up my project using zig init and then replaced the zig sources with my main.cpp according to the documentation I found on how to declare a C++ executable.
Then I added raylib as dependency to my build.zig.zon using zig fetch.
At this point I’m stuck. How do I actually import raylib as module from my dependencies, link it to my executable and make sure to add its includes?
Are there some additional requirements to raylib’s build.zig [1] to be able to do so, e.g. an explicit module export statement? And if yes, is that requirement fulfilled?
[1] https://raw.githubusercontent.com/raysan5/raylib/refs/heads/master/build.zig