Each library domain (kernel, device, client, protocol, csv, xkeyboard-config) now owns a build.zig + build.zig.zon that wires and exports its modules, with a standalone `zig build test` per domain. The kernel package also exports abi (source stays in system/abi.zig) so every consumer names one module instance. The root build swaps its createModule calls for b.dependency(...).module(...) — no binary moves; the root is the pilot consumer (docs/build-packages-plan.md). Path dependencies deduplicate by resolved location, so the diamond (root -> device -> kernel, root -> kernel) yields a single instance of each module. Boot-image file list unchanged.
30 lines
1018 B
Zig
30 lines
1018 B
Zig
//! The "client" library domain (library/client): userspace-service clients —
|
|
//! they talk to services over IPC, not to the kernel.
|
|
|
|
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const kernel = b.dependency("kernel", .{});
|
|
const protocol = b.dependency("protocol", .{});
|
|
|
|
const ipc = kernel.module("ipc");
|
|
const time = kernel.module("time");
|
|
|
|
_ = b.addModule("display", .{
|
|
.root_source_file = b.path("display/display.zig"),
|
|
.imports = &.{
|
|
.{ .name = "ipc", .module = ipc },
|
|
.{ .name = "time", .module = time },
|
|
.{ .name = "display-protocol", .module = protocol.module("display-protocol") },
|
|
},
|
|
});
|
|
_ = b.addModule("input", .{
|
|
.root_source_file = b.path("input/input.zig"),
|
|
.imports = &.{
|
|
.{ .name = "ipc", .module = ipc },
|
|
.{ .name = "time", .module = time },
|
|
.{ .name = "input-protocol", .module = protocol.module("input-protocol") },
|
|
},
|
|
});
|
|
}
|