i’ve googled around and found a simple solution - to add to build.zig something like exe.addIncludeDir("/usr/include");
while it itself looks like a hack - I cannot even find addIncludeDir function in zig 0.11, and cannot find any release notes about it…
Oh thank you!
By the way, is this the best way to do it? Sounds like including standard locations like /usr/include may be done with some special flag/option/function, no?
That does not seem to work anymore. The build system will complain about e.g. /usr/include being an absolute path and then continue to crash; you can use something like ../../../../../usr/include, but that kinda feels stupid.
The error message printed when you use b.path("/usr/include") tells you what to do:
sub_path is expected to be relative to the build root, but was this absolute path: ‘/usr/include’. It is best avoid absolute paths, but if you must, it is supported by LazyPath.cwd_relative
In other words, replace it with std.Build.LazyPath{ .cwd_relative = "/usr/include" }, like so:
b.path() is only meant for subpaths of the build root (the directory containing your build.zig file). I’m surprised it even allows b.path("../../../../../usr/include"), this seems like a bug.