From 52b2ca78aed7950af27d4865aee65da781514a99 Mon Sep 17 00:00:00 2001 From: T Date: Sun, 26 Apr 2026 11:09:37 -0600 Subject: Initial work, and name change to pantograph --- build.zig | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 build.zig (limited to 'build.zig') diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..f7d7149 --- /dev/null +++ b/build.zig @@ -0,0 +1,52 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const libpanto_dep = b.dependency("libpanto", .{ + .target = target, + .optimize = optimize, + }); + + // CLI executable + const exe_mod = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + exe_mod.addImport("libpanto", libpanto_dep.module("libpanto")); + + const exe = b.addExecutable(.{ + .name = "panto", + .root_module = exe_mod, + }); + + b.installArtifact(exe); + + const run_cmd = b.addRunArtifact(exe); + run_cmd.step.dependOn(b.getInstallStep()); + if (b.args) |args| { + run_cmd.addArgs(args); + } + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); + + // CLI unit tests (minimal — most tests live in libpanto) + const test_mod = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + test_mod.addImport("libpanto", libpanto_dep.module("libpanto")); + + const unit_tests = b.addTest(.{ + .name = "panto-tests", + .root_module = test_mod, + }); + + const run_unit_tests = b.addRunArtifact(unit_tests); + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&run_unit_tests.step); +} -- cgit v1.3