anonymousDepencency has been giving me some trouble.
attached photo is my file structure, i made a new project just to simplify things.
this is the code to import dep's module:
const loc_dep = b.anonymousDependency("dep/", @import("dep/build.zig"), .{
.target = target,
.optimize = optimize,
});
exe.addModule("dep", loc_dep.module("test-thing"));
this is dep's build.zig (well the important parts)
const raylib_dep = b.dependency("raylib", .{
.target = target,
.optimize = optimize,
});
const raylib = raylib_dep.artifact("raylib");
b.installArtifact(raylib);
_ = b.addModule("test-thing", .{
.source_file = std.Build.FileSource.relative("src/main.zig"),
});
this is dep's build.zig.zon:
.{
.name = "zentig-raylib",
.version = "0.1.0",
.dependencies = .{
.raylib = .{
.url = "https://github.com/raysan5/raylib/archive/7124a14a60a4bf7e4357030395750e03a1b976b2.tar.gz",
.hash = "1220cb899cf05b87a116323b64419278bddb116b07394c3a5ce60c65f6aae7fafc8a",
},
},
}
and i get this error:
no dependency named 'raylib' in 'USER\zig\package_manager_anon_dep\dep\build.zig.zon'. All packages used in build.zig must be declared in this file.
what am i doing wrong?