I’ve gotten this to work when I pull in a c dependency using zig fetch because I can get a LazyPath from the dependency. But since the b.path() is relative to the build, how would I do that for a system library in /usr/include. I could hard code it, but is there a better way?
You also could use an actual .c or .h file that contains similar code, I originally saw somebody turn it into a single expr .root_source_file = b.addWriteFiles().add(...) that also works, but I don’t remember where I saw it.
That helps with how to get the #include <dbus/dbus.h> in there, but I ran into the following error.
error: ‘dbus/dbus.h’ file not found
It looks like the addTranslateC step does not have any include paths by default, it’s not picking up the system include path. In fact, adding debug printing on the include paths doesn’t print any paths: