mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
do more robust import
Co-authored-by: Carl Åstholm <carl@astholm.se>
This commit is contained in:
parent
0820aa4a46
commit
1b4ea80654
1 changed files with 1 additions and 5 deletions
|
|
@ -6,11 +6,7 @@ pub fn build(b: *std.Build) void {
|
||||||
|
|
||||||
const dep1 = b.dependency("other", .{});
|
const dep1 = b.dependency("other", .{});
|
||||||
|
|
||||||
const build_runner = @import("root");
|
const dep2 = b.dependencyFromBuildZig(@import("other"), .{});
|
||||||
const deps = build_runner.dependencies;
|
|
||||||
const zon_decls = @typeInfo(deps.packages).Struct.decls;
|
|
||||||
const pkg = @field(deps.packages, zon_decls[0].name);
|
|
||||||
const dep2 = b.dependencyFromBuildZig(pkg.build_zig, .{});
|
|
||||||
|
|
||||||
std.debug.assert(dep1.module("add") == dep2.module("add"));
|
std.debug.assert(dep1.module("add") == dep2.module("add"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue