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:
- You edit
project.cue. ./gen_build_spec.shrunscue export -e build. CUE unifies your declarations withschema.cue, resolves defaults, maps eachprofileto an optimization mode, and rejects anything invalid.- The same script pipes the resolved JSON through
python3and writesbuild_spec.zig, a plain Zig array. zig buildimportsbuild_spec.zigat 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.