Hi all, I’ve spent some time now figuring out the proper way to use the dependencies declared in the build.zig.zon
file
I’ve been trying to import either capy or raylib without success.
I know Capy relies on zigmod, and raylib expects to be a git submodule, but I’d like to use the .zon
file.
my build.zig.zon
.{
.version = "0.0.0",
.name = "test",
.dependencies = .{
.capy = .{
.url = "https://github.com/capy-ui/capy/archive/refs/heads/master.tar.gz",
.hash = "1220836cd761d0afd2c837a59e806d4b63c0d73ea6868a6f3e66485a1d9fa9c067bb"
}
},
}
I’m doing what zls project does to add dependencies
const capy = b.dependency("capy", .{}).module("capy");
exe.addModule("capy", capy);
after changing this line in the downloaded capy cache
var examplesDir = try std.fs.cwd().openIterableDir("examples", .{});
to
var examplesDir = try b.build_root.handle.openIterableDir("examples", .{});
I get
panic("unable to find module '{s}'", .{name});
const capy = b.dependency("capy", .{}).module("capy");
^
I tried looking at sources, but I really can’t figure out how the build system works…
Thanks in advance