Skip to content

Commit 1b4ea80

Browse files
nektrocastholm
andauthored
do more robust import
Co-authored-by: Carl Åstholm <[email protected]>
1 parent 0820aa4 commit 1b4ea80

File tree

1 file changed

+1
-5
lines changed
  • test/standalone/dependencyFromBuildZig

1 file changed

+1
-5
lines changed

test/standalone/dependencyFromBuildZig/build.zig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ pub fn build(b: *std.Build) void {
66

77
const dep1 = b.dependency("other", .{});
88

9-
const build_runner = @import("root");
10-
const deps = build_runner.dependencies;
11-
const zon_decls = @typeInfo(deps.packages).Struct.decls;
12-
const pkg = @field(deps.packages, zon_decls[0].name);
13-
const dep2 = b.dependencyFromBuildZig(pkg.build_zig, .{});
9+
const dep2 = b.dependencyFromBuildZig(@import("other"), .{});
1410

1511
std.debug.assert(dep1.module("add") == dep2.module("add"));
1612
}

0 commit comments

Comments
 (0)