diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-26 12:00:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-26 12:00:20 -0300 |
| commit | 85cf1a7dd912db4a5fc3ac2cb9d8550050ffbdb0 (patch) | |
| tree | 29e772435e74bfc86ee58483ce900b24f1e3ae6b /build.zig | |
| parent | adb23572bc2d7aae09cf8605825f6d48ca23ba4a (diff) | |
| download | esp32p4-85cf1a7dd912db4a5fc3ac2cb9d8550050ffbdb0.tar.gz esp32p4-85cf1a7dd912db4a5fc3ac2cb9d8550050ffbdb0.zip | |
Pass -Dtheme-animation through to the editor's build
The firmware build already rebuilds pardes's object when the grid changes, for the reason
that changing it in one directory and linking in another silently links the previous answer.
The chrome fade is the same shape of setting - baked into the object, wanted from here - so
it travels the same path: -Dtheme-animation is forwarded to the nested build, and like the
geometry it is skipped entirely when -Dpardes-obj names an object explicitly.
Measured either way on the die: the fade costs 1,097 ms of wire per theme change against 215
without it, and compiling it out takes 2,336 bytes off the image. Both numbers are in the
comment above the option in ../02-pardes-code/build.zig.
Board reflashed with the default (md5 018a9554e4a8ae51); p4-bench --check 4/4; host tests
green.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -305,12 +305,14 @@ pub fn build(b: *std.Build) void { // an object explicitly, because then the caller has said which one they want. const cols = b.option(u16, "cols", "board grid width in cells; rebuilds pardes's object"); const rows = b.option(u16, "rows", "board grid height in cells; rebuilds pardes's object"); - if ((cols != null or rows != null) and b.user_input_options.get("pardes-obj") == null) { + const theme_anim = b.option(bool, "theme-animation", "fade chrome colors across a theme change; rebuilds pardes's object (default off on this transport)"); + if ((cols != null or rows != null or theme_anim != null) and b.user_input_options.get("pardes-obj") == null) { const editor_dir = std.fs.path.dirname(std.fs.path.dirname(obj) orelse ".") orelse ".."; const build_editor = b.addSystemCommand(&.{ b.graph.zig_exe, "build", "-Dplatform=p4" }); build_editor.setCwd(.{ .cwd_relative = editor_dir }); if (cols) |c| build_editor.addArg(b.fmt("-Dp4-cols={d}", .{c})); if (rows) |v| build_editor.addArg(b.fmt("-Dp4-rows={d}", .{v})); + if (theme_anim) |a| build_editor.addArg(b.fmt("-Dtheme-animation={}", .{a})); // Its output is a file this build then links, and the linker has no idea it is generated, // so the ordering has to be said out loud. build_editor.has_side_effects = true; |
