logoalt Hacker News

C/C++ projects packaged for Zig

30 pointsby jcbhmryesterday at 11:09 PM21 commentsview on HN

Comments

fuhsnntoday at 1:09 AM

These look more like configure snapshots for Zig's bundled Clang than full ports of build system.

The HAVE_/WITH_ defines are supposed to be dynamically probed to adapt to different toolchain environments, setting them manually like that[1][2][3] could only work well for specific targets and for specific versions.

[1] https://github.com/allyourcodebase/libxml2/blob/38fb69d375bc...

[2] https://github.com/allyourcodebase/rnnoise/blob/47db9c212d7e...

[3] https://github.com/allyourcodebase/wayland/blob/f992cd71e199...

gracefullibertyyesterday at 11:27 PM

Both an excellent showcase of the Zig build system and a convenient way to use C libraries within Zig.

rtpgyesterday at 11:58 PM

I'm a bit worried this is intro'ing the classic problem we have in Bazel land, where everyone is having to show up with their own sort of packaging scripts etc instead of using upstream tooling one way or another.

I had the impression `zig` already has stuff like `zig cc`. Would... would `zig make` be an impossible proposition? Maybe that makes no sense.

show 6 replies
jeremyjhtoday at 12:10 AM

I just looked at one example...Wayland's meson.build is 142 LOC, but build.zig is 581.

https://github.com/allyourcodebase/wayland/blob/master/build... https://github.com/wayland-mirror/wayland/blob/main/meson.bu...

show 2 replies