From C build systems to Zig

In relation to How to zig a C project?:

It would really be neat if there were guides on how to move a C project to the Zig build system, taking into account the (most popular) C build tools such as make, CMake, Autotools, etc. If you’re like me and lack a C background, running into a project with huge make files and tons of configure script options and pre-processor maco -DSOME_VAR can be daunting. For example (and this may be an extreme) would it be possible to move the Linux Kernel to the Zig build system?

5 Likes

…or you’re like me and much of the C/C++ community who find this stuff still daunting regardless of our background, lol.

Just wanted to throw that out there - I think C/C++ developers are severely disadvantaged because of the frustrating build systems that inevitably haunt these projects. Multiple levels of CMakeLists.txt file-trees… good times :slight_smile:

I think there’s a chance to merge some ideas from this thread into here as it develops: https://ziggit.dev/t/advice-on-linking-cuda-to-zig/

3 Likes

In general, the ziglang wiki is underdeveloped. The topic in question is something that should be covered there–among many other things.

4 Likes

I’m still looking for a guide on how to use C libaries in Zig. I know there are some techniques there which programmers are using, which aren’t already covered in the docs. But I couldn’t find anything beyond just looking through existing repos. Knowing more about how Zig/C interop in general would also help when working with the build systems of existing C projects.

3 Likes