summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 03:06:49 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit98f84f99e79cccc2344aff2efe10823540d0c7b7 (patch)
tree0e11fcb0a2252858dc8c7b442a9c78152af5a585 /build.zig
parentf749eb712d990a9b03f1db372d5311e77bd32edd (diff)
downloadpardes-98f84f99e79cccc2344aff2efe10823540d0c7b7.tar.gz
pardes-98f84f99e79cccc2344aff2efe10823540d0c7b7.zip
plain: the records the core and the terminal both name, a leaf module (docs/next-terminal.md, Phase 1, its first step): src/plain/plain.zig takes Color, FontRole, CellStyle, Cell, RectPx, RectCell, Raster and Placement from surface.zig and Key from Event.zig, moved as they are, and imports std alone; surface.zig and Event.zig re-export them under their old names, so no caller changes; src/term/'s files name them through `plain` (pager.zig and TerminalImages.zig no longer reach surface.zig); build.zig's wireCore gives every core module the `plain` import; locations.Row stays (it names look.Spot and walk's digest: not free); core-test 985 of 985, lib-test
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 903b7ea8..f59d1928 100644
--- a/build.zig
+++ b/build.zig
@@ -836,7 +836,10 @@ pub fn build(b: *std.Build) void {
image_mod.addCSourceFile(.{ .file = b.path("addons/image/stb.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } });
const image_addon = b.addLibrary(.{ .name = "image", .linkage = .dynamic, .root_module = image_mod });
for (builtin_mods) |m| m.addImport("image_addon", image_mod);
+ // The records the core and the terminal both name (src/plain/plain.zig).
+ const plain_mod = b.createModule(.{ .root_source_file = b.path("src/plain/plain.zig"), .target = target, .optimize = optimize });
for (core_mods) |m| wireCore(m, .{
+ .plain = plain_mod,
.kind = kind_mod,
.themes = themes_mod,
.tree_sitter = ts_mod,
@@ -2188,6 +2191,7 @@ fn library(b: *std.Build) void {
}
fn wireCore(m: *std.Build.Module, d: struct {
+ plain: ?*std.Build.Module = null,
kind: ?*std.Build.Module = null,
themes: ?*std.Build.Module = null,
tree_sitter: ?*std.Build.Module = null,
@@ -2202,6 +2206,7 @@ fn wireCore(m: *std.Build.Module, d: struct {
wuffs: ?*std.Build.Module = null,
xitdb: ?*std.Build.Module = null,
}) void {
+ if (d.plain) |x| m.addImport("plain", x);
if (d.kind) |x| m.addImport("pardes_addon", x);
if (d.themes) |x| m.addImport("generated_themes", x);
if (d.tree_sitter) |x| m.addImport("tree-sitter", x);