cmake-zig
https://codeberg.org/Jan200101/cmake-zig
Want to integrate your Zig code into an existing non-Zig codebase?
cmake-zig is an example of how this can be done:
On the master branch custom cmake logic is used to convert Zig code to C and then compile that C code directly in cmake.
The downsides to this approach are that you cannot use Zig dependencies or the build system, that the C backend is a bit… buggy and that it does not work with non-clang compilers.
On the buildsystem-integration branch is a deeper showcase that uses a custom build-runner for 0.16 to build a zig project and import all artifacts into cmake.
With this approach any Zig project can be build and transparently used in cmake (as far as those projects support)
An example of this being used in action is pico-zdk, a project which combines plain Zig code with a custom IO implementation to run on an RP2040 using the pico-sdk.