add(zig-interface): dependency to check interface contracts at comptime
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 53s

The described interfaces for `Widget` and `Layout` are now defined and
correspondingly checked at comptime.
This commit is contained in:
2024-11-12 23:13:35 +01:00
parent 07e4819ecd
commit 28817d468a
8 changed files with 80 additions and 46 deletions

View File

@@ -15,13 +15,21 @@ pub fn build(b: *std.Build) void {
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});
const zg = b.dependency("zg", .{});
const zg = b.dependency("zg", .{
.target = target,
.optimize = optimize,
});
const interface = b.dependency("interface", .{
.target = target,
.optimize = optimize,
});
const lib = b.addModule("zterm", .{
.root_source_file = b.path("src/zterm.zig"),
.target = target,
.optimize = optimize,
});
lib.addImport("interface", interface.module("interface"));
lib.addImport("code_point", zg.module("code_point"));
const exe = b.addExecutable(.{