To compile multiple target programs within a single build.zig file, I've used a "Targ" struct, and created an array of these. Once created, the build file can loop around and compile each element.
Lately, been wanting to add a "libs" field that some targets may have, others may not have it. Perhaps something like this:
const Targ = struct {
name: []const u8,
src: []const u8,
libs: ?????
}
const targs = [_] Targ{
.{
.name = "foo",
.src = "src/foo.zig",
},
.{
.name = "bar",
.src = "src/bar.zig",
.libs = .{"jpeg", "tiff"},
},
};
I do not know what type the "libs" field should have. Also, the above instantiation of "targs" above will not compile.
Any hints on how to implement?