aboutsummaryrefslogtreecommitdiff
path: root/src/Package.zig
diff options
context:
space:
mode:
authorantlilja <liljaanton2001@gmail.com>2023-03-09 20:39:15 +0100
committerAndrew Kelley <andrew@ziglang.org>2023-03-09 22:38:14 -0500
commitb445bbfea205702770e4e9de4e456c3e8750f8ed (patch)
treedbb29397a922be4c1f6337f0e17fb3e0f40d7746 /src/Package.zig
parent7c9ed45ac2fd580bbbb4b950ac350dd49fc7600e (diff)
downloadzig-b445bbfea205702770e4e9de4e456c3e8750f8ed.tar.gz
zig-b445bbfea205702770e4e9de4e456c3e8750f8ed.zip
Add ability to import dependencies from build.zig
Diffstat (limited to 'src/Package.zig')
-rw-r--r--src/Package.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Package.zig b/src/Package.zig
index ed93500980..c238d3d567 100644
--- a/src/Package.zig
+++ b/src/Package.zig
@@ -215,6 +215,7 @@ pub const build_zig_basename = "build.zig";
pub fn fetchAndAddDependencies(
pkg: *Package,
+ root_pkg: *Package,
arena: Allocator,
thread_pool: *ThreadPool,
http_client: *std.http.Client,
@@ -295,7 +296,8 @@ pub fn fetchAndAddDependencies(
all_modules,
);
- try pkg.fetchAndAddDependencies(
+ try sub_pkg.fetchAndAddDependencies(
+ root_pkg,
arena,
thread_pool,
http_client,
@@ -309,7 +311,8 @@ pub fn fetchAndAddDependencies(
all_modules,
);
- try add(pkg, gpa, fqn, sub_pkg);
+ try pkg.add(gpa, name, sub_pkg);
+ try root_pkg.add(gpa, fqn, sub_pkg);
try dependencies_source.writer().print(" pub const {s} = @import(\"{}\");\n", .{
std.zig.fmtId(fqn), std.zig.fmtEscapes(fqn),