The Example Matrix
Twenty-seven directories live under examples/. Each has a README covering what
it demonstrates, its prerequisites, and the exact command to build and run it.
examples/README.md is the index.
Eighteen of them form the verified matrix, run in sequence by one target:
zig build example-matrix
That runs, in order:
run-hello-zaza proof-library-run generated-code-run
package-consumer-run mixed-stack-run interface-object-graph-run
test-workflows-run generated-headers-run shared-plugin-run
preset-profiles-run cross-compile-cli-report resources-bundle-run
bindings-run benchmark-workflow-run cxx20-modules-run
wasm-wasi-report wasm-exports-run wasm-web-demo-smoke
Each entry shells out to ./zig build <target>, so the wrapper must exist. Runs
are chained rather than parallel, which keeps failure attribution simple.
The matrix omits the examples that need network access or heavy external
toolchains: the three CMake examples, the two JUCE examples, json, and
rust_interop. Those are documented individually and run on their own.
What each one covers
| Example | Command | Demonstrates |
|---|---|---|
| hello_zaza | zig build run-hello-zaza | A Zig exe and a C++ exe in one graph |
| proof_library | zig build proof-library-run | A static library with install/export metadata |
| generated_code | zig build generated-code-run | A custom command generating a .cpp |
| generated_headers | zig build generated-headers-run | A custom command generating a header |
| package_producer | zig build package-producer-run | Publishing headers, an archive, and a manifest |
| package_consumer | zig build package-consumer-run | Consuming that package from a separate build |
| mixed_stack | zig build mixed-stack-run | C library, C++ bridge, Zig executable |
| interface_object_graph | zig build interface-object-graph-run | Object library folded into a static library |
| test_workflows | zig build test-workflows-run | Run modes differing by arg, env, and cwd |
| shared_plugin | zig build shared-plugin-run | A shared library loaded at runtime via dlopen |
| preset_profiles | zig build preset-profiles-run | ZAZA_PRESET selecting a configuration |
| cross_compile_cli | zig build cross-compile-cli-report | A nested build for a non-host triple |
| resources_bundle | zig build resources-bundle-run | A runtime asset staged into zig-out/share |
| bindings | zig build bindings-run | Zig calling C++ across a C ABI wrapper |
| benchmark_workflow | zig build benchmark-workflow-run | A benchmark as size-specific run targets |
| cxx20_modules | zig build cxx20-modules-run | A C++20 named-module pipeline |
| wasm_wasi | zig build wasm-wasi-report | A wasm32-wasi-musl executable, validated |
| wasm_exports | zig build wasm-exports-run | A freestanding wasm module with exports |
| rust_interop | zig build rust-interop-run | A Cargo staticlib linked into a Zig executable |
| json | zig build run | nlohmann/json as a Zig package dependency |
| cmake_shim | zig build cmake-shim-run | The smallest complete CMake interop path |
| cmake_combo | zig build cmake-combo-run | fmt + spdlog built by CMake, linked by Zig |
| cmake_net | zig build cmake-net-run | curl + zlib + mbedtls with an ordering constraint |
| juce | zig build juce | A JUCE GUI app through JUCE's CMake integration |
| zaza-juce | zig build zaza-juce | A JUCE audio app with the audio modules on |
Prefix each with ZAZA_EXAMPLES=<name> to build just that example.
Two of the twenty-six directories are not examples. examples/cmake is an early experiment that is not
wired into the root build and does not compile as written. examples/json
builds the repo-root src/main.cpp rather than its own source file.