diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 21:23:22 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-18 21:43:03 -0300 |
| commit | f9a3179542012ec1a700e2020ac9f616b819f972 (patch) | |
| tree | 73f4cb241876196331f7b28c9f773301bd341a7f /build/core.zig | |
| parent | a75956bb3443aa8aac778d2ff12c42f5ef99e0e9 (diff) | |
| download | pardes-f9a3179542012ec1a700e2020ac9f616b819f972.tar.gz pardes-f9a3179542012ec1a700e2020ac9f616b819f972.zip | |
dev: the frontends (dev/tui, dev/gui, the macOS app's Swift and resources in dev/macos), host_io, file_watch, fonts, the lsp client and Scip, Art, jump_trail, glide and vaxis_input into dev/ (the reorganisation's tree, step 2b): module `dev` (dev/root.zig) beside the core and the runtime, each naming the others; the window wired into it, sketchbook's devices imported as `sketchbook` (its `dev` would be ours); pardes.zig keeps its re-exports (host_io, file_watch, glide, fonts) so every caller reads as before; core-test and shell-test run the devices' test program too, so the same tests run (the ledger, tui and gui); nothing else changes: frames byte-identical, replicas and process-test the base's
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'build/core.zig')
| -rw-r--r-- | build/core.zig | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/build/core.zig b/build/core.zig index 8749d612..56a047c0 100644 --- a/build/core.zig +++ b/build/core.zig @@ -318,18 +318,19 @@ pub const Core = struct { util: bool = false, }; -/// What `module` makes: the core and the runtime, each naming the other -/// (`core`, `runtime`), and the module a compile roots at. +/// What `module` makes: the core, the devices and the runtime, each naming +/// the others (`core`, `dev`, `runtime`), and the module a compile roots at. pub const Modules = struct { /// A product's own file (runtime/main.zig, runtime/macos.zig) naming /// both, the runtime, or the core. root: *std.Build.Module, core: *std.Build.Module, + dev: *std.Build.Module, runtime: *std.Build.Module, }; -/// A core and the runtime beside it, everything they import and link -/// named here and nowhere else. +/// A core and the devices and runtime beside it, everything they import +/// and link named here and nowhere else. pub fn module(b: *std.Build, p: Parts, c: Core) Modules { const in_runtime = std.mem.startsWith(u8, c.root, "runtime/"); const m = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path(if (in_runtime) "src/pardes.zig" else c.root), .link_libc = true }); @@ -356,9 +357,10 @@ pub fn module(b: *std.Build, p: Parts, c: Core) Modules { for (p.ts.libs.items) |lib| m.linkLibrary(lib); // The /src tree's files that live outside the core's directory // (fs.zig embeds them under the names they had there). - if (p.embed_sources) for ([_][]const u8{ "runtime/9p.zig", "runtime/9p_io.zig", "runtime/main.zig" }) |f| + if (p.embed_sources) for ([_][]const u8{ "runtime/9p.zig", "runtime/9p_io.zig", "runtime/main.zig", "dev/host_io.zig" }) |f| m.addAnonymousImport(f, .{ .root_source_file = b.path(f) }); const runtime = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path("runtime/root.zig"), .link_libc = true }); + const dev = b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path("dev/root.zig"), .link_libc = true }); const root = if (!in_runtime) m else if (std.mem.eql(u8, c.root, "runtime/root.zig")) runtime else b.createModule(.{ .target = p.target, .optimize = p.optimize, .root_source_file = b.path(c.root), .link_libc = true }); // Each options module once, so that the modules share it: a file is in // one module of a compilation. @@ -368,7 +370,7 @@ pub fn module(b: *std.Build, p: Parts, c: Core) Modules { const pardes_config = c.config.createModule(); const pardes_isolation = (if (c.isolated) p.iso_on else p.iso_off).createModule(); const builtin_addons = (if (c.builtin_addons) p.builtin_on else p.builtin_off).createModule(); - for ([_]*std.Build.Module{ m, runtime, root }) |x| { + for ([_]*std.Build.Module{ m, dev, runtime, root }) |x| { x.addImport("cloud9", p.cloud9); if (c.builtin_addons) if (p.pdf) |pdf| x.addImport("pdf_addon", pdf); if (c.builtin_addons) x.addImport("image_addon", p.image); @@ -390,9 +392,10 @@ pub fn module(b: *std.Build, p: Parts, c: Core) Modules { x.addImport("pardes_isolation", pardes_isolation); x.addImport("builtin_addons", builtin_addons); x.addImport("core", m); + x.addImport("dev", dev); x.addImport("runtime", runtime); } - return .{ .root = root, .core = m, .runtime = runtime }; + return .{ .root = root, .core = m, .dev = dev, .runtime = runtime }; } /// What `assemble` makes besides the parts: the shells' options, the |
