summaryrefslogtreecommitdiff
path: root/anim/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/build.zig')
-rw-r--r--anim/build.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/anim/build.zig b/anim/build.zig
index 54ff589..4a2ec76 100644
--- a/anim/build.zig
+++ b/anim/build.zig
@@ -227,6 +227,11 @@ pub fn build(b: *std.Build) void {
// pictures change when the drawing does and not when a new recording does.
_ = embedded.addCopyFile(b.path("test/gallery/list.ztrace"), "gallery.ztrace");
table.print(b.allocator, "pub const gallery: Program = .{{ .trace = @embedFile(\"gallery.ztrace\"), .file = \"list.c\", .source = @embedFile(\"list.c\") }};\n", .{}) catch @panic("OOM");
+ // And for its graph pages, sort's and hello's, kept as they were recorded with blocks.
+ for ([_][2][]const u8{ .{ "sort", "sort.c" }, .{ "hello", "hello.c" } }) |kept| {
+ _ = embedded.addCopyFile(b.path(b.fmt("test/gallery/{s}.ztrace", .{kept[0]})), b.fmt("gallery-{s}.ztrace", .{kept[0]}));
+ table.print(b.allocator, "pub const gallery_{s}: Program = .{{ .trace = @embedFile(\"gallery-{s}.ztrace\"), .file = \"{s}\", .source = @embedFile(\"{s}\") }};\n", .{ kept[0], kept[0], kept[1], kept[1] }) catch @panic("OOM");
+ }
const recordings = b.createModule(.{ .root_source_file = embedded.add("recordings.zig", b.fmt(
\\//! Generated by canim's build.zig: the recordings and the sources they ran.
\\pub const Program = struct {{ trace: []const u8, file: []const u8, source: []const u8 }};