[Question] Build package with submodule

You can add flx-c as a dependency to zig-flx’s build.zig.zon without adding anything to flx-c. The problem, I believe, is that you can only use dependency’s artifacts and modules that have been exposed in its build.zig. So, in order to actually see and use those C source files in zig-flx, you’ll need to add a build.zig to flx-c and expose them somehow. You could probably create a Zig file c_lib.zig in flx-c that imports all of the C headers and expose it in the new build.zig as a module like so:

_ = b.addModule("c_lib.zig", .{ .root_source_file = root_source_file });
1 Like