The Pipeline

project.cue  ->  cue export  ->  build_spec.zig  ->  zig build  ->  binaries
   (you)         (validates)      (generated)        (executes)     (zig-out/)
     |                |
  schema.cue     export.cue
  (types)        (what to emit)

Step by step:

  1. You edit project.cue.
  2. ./gen_build_spec.sh runs cue export -e build. CUE unifies your declarations with schema.cue, resolves defaults, maps each profile to an optimization mode, and rejects anything invalid.
  3. The same script pipes the resolved JSON through python3 and writes build_spec.zig, a plain Zig array.
  4. zig build imports build_spec.zig at comptime and walks it.

build_spec.zig is gitignored. It is regenerated, never edited.

Run step 2 after every change to project.cue, export.cue or schema.cue. Nothing watches for you.