Files
aji/build.zig
T
dev 17a55a7fef Initial import: Aji 0.1 draft spec and Zig scaffolding
Draft specification, RFCs, reference registries and examples, plus the
reference-implementation skeleton: build.zig, diagnostic envelope with
error-code registry synced to docs, aji CLI, conformance runner with seed
tests, CI and contributor docs.
2026-10-04 11:59:13 +03:00

57 lines
2.1 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Library: verifier, AIR, interpreter. Everything the TCB contains lives here.
const mod = b.addModule("aji", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
// The error-code registry in docs/ is the source of truth; a test keeps
// src/diag.zig in sync with it.
mod.addAnonymousImport("error_codes_md", .{
.root_source_file = b.path("docs/reference/error-codes.md"),
});
// CLI: `aji`.
const exe = b.addExecutable(.{
.name = "aji",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.imports = &.{.{ .name = "aji", .module = mod }},
}),
});
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
run_cmd.addPassthruArgs();
b.step("run", "Run the aji CLI").dependOn(&run_cmd.step);
// Unit tests.
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = mod })).step);
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = exe.root_module })).step);
// Conformance suite runner (tests/conformance).
const conformance = b.addExecutable(.{
.name = "aji-conformance",
.root_module = b.createModule(.{
.root_source_file = b.path("tools/conformance.zig"),
.target = target,
.optimize = optimize,
.imports = &.{.{ .name = "aji", .module = mod }},
}),
});
const run_conformance = b.addRunArtifact(conformance);
run_conformance.addArg("tests/conformance");
run_conformance.addPassthruArgs();
b.step("conformance", "Run the conformance suite").dependOn(&run_conformance.step);
test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = conformance.root_module })).step);
}