Calling zig build-lib -femit-h my_lib_source.zig, a c-header file can be exported for a library written in zig.
How can the same be achieved in build.zig?
Could this be achieved with an option to b.installArtifact?
I found no documentation about this at https://ziglearn.org/chapter-3/.
Assuming you've created a lib compile step as
const lib = b.addStaticLibrary(...)you can writewhich should install the generated header file into a folder called
includeinsidezig-out