Artifact 52f673e9501bbe1fa1ea095a58c96e68c4a356792780962d70ec92a0b631a714:
- File
build.zig
— part of check-in
[0ae7fb2622]
at
2026-07-08 21:53:01
on branch trunk
— Scaffold zit: Zig project + RFC references + module layout
Fossil-in-Zig, ported from the four RFC drafts (docs/rfcs/). Layout mirrors the RFC layering: delta -> artifact -> repostate -> sync. delta int codec + checksum and artifact naming/Z-card implemented with RFC-derived test vectors; everything else stubbed against its section. Builds clean; zig build test green. See docs/HANDOFF.md. (user: dmestas, size: 1454) [annotate] [blame] [check-ins using]
const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); // The zit library: a Zig implementation of the Fossil formats and protocol // as specified by the four RFC drafts in docs/rfcs/. const mod = b.addModule("zit", .{ .root_source_file = b.path("src/root.zig"), .target = target, }); // The `zit` command-line tool. const exe = b.addExecutable(.{ .name = "zit", .root_module = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, .imports = &.{ .{ .name = "zit", .module = mod }, }, }), }); b.installArtifact(exe); // `zig build run -- <args>` const run_step = b.step("run", "Run the zit CLI"); const run_cmd = b.addRunArtifact(exe); run_step.dependOn(&run_cmd.step); run_cmd.step.dependOn(b.getInstallStep()); if (b.args) |args| run_cmd.addArgs(args); // `zig build test` — runs library + CLI unit tests. const test_step = b.step("test", "Run unit tests"); const mod_tests = b.addTest(.{ .root_module = mod }); test_step.dependOn(&b.addRunArtifact(mod_tests).step); const exe_tests = b.addTest(.{ .root_module = exe.root_module }); test_step.dependOn(&b.addRunArtifact(exe_tests).step); }