With the recent Zig build system changes, Modules now work much like CMake library targets, in that settings applied to one module are applied to any other module which imports that module as a dependency. For example, with my current changes, I'm able to do the following (at least for my use case):
// Example setup in build.zig
const sqlite = b.dependency("sqlite", .{
.target = target,
.optimize = optimize,
.use_bundled = true,
});
exe.root_module.addImport("sqlite", sqlite.module("sqlite"));
// Note that we no longer need to access and link to the "sqlite" artifact,
// nor add any include directories
Description
With the recent Zig build system changes, Modules now work much like CMake library targets, in that settings applied to one module are applied to any other module which imports that module as a dependency. For example, with my current changes, I'm able to do the following (at least for my use case):