A Zig-driven build system for modern C, C++, Zig, CMake-interop, and WebAssembly workflows.
Explore the docs »
View Examples
·
Report Bug
·
Request Feature
Table of Contents
Zaza makes new native projects feel simpler than CMake without giving up serious target graphs, package flows, generated code, cross-compilation, or browser-adjacent outputs.
Why Zaza:
- Zig build graph as the control plane instead of a separate DSL
- First-class mixed-language workflows: C, C++, and Zig in one repo
- Real examples for generated sources, shared plugins, packaging, presets, CMake interop, and wasm
- One verified matrix command for the entire example surface
Status: Zaza is usable and heavily example-driven, but it is not pretending to have a final polished API yet. The verified example matrix is runnable with zig build example-matrix.
- Clone the repo
git clone https://github.com/godofecht/zaza.git
- Enter the project directory
cd zaza - (Optional) Allow direnv
direnv allow
- Verify the build
zig build test zig build example-matrix
Useful first commands:
zig build run-hello-zaza
zig build package-consumer-run
zig build mixed-stack-run
zig build wasm-web-demo-smoke
zig build wasm-web-demo-serveIf a target needs external tools such as git or cmake, enable them explicitly:
ZAZA_SYSTEM_CMDS=1 zig build cmake-shimNaming conventions:
| Pattern | Meaning |
|---|---|
<name> |
Build or stage the artifact |
<name>-run |
Execute something real |
<name>-report |
Inspect or validate an artifact |
<name>-serve |
Start a local server |
Minimal build.zig example:
const std = @import("std");
const cpp = @import("build/cpp_example.zig");
pub fn build(b: *std.Build) !void {
const exe = try cpp.CppExample.executable(.{
.name = "my_app",
.source_files = &.{"src/main.cpp"},
.public_include_dirs = &.{"include"},
.public_defines = &.{"MY_APP=1"},
.cpp_std = "17",
}).build(b);
const run_cmd = b.addRunArtifact(exe);
const run_step = b.step("run", "Run my_app");
run_step.dependOn(&run_cmd.step);
}For the full syntax surface, please refer to the Syntax Reference.
| Workflow | Command |
|---|---|
| Mixed Zig + C++ | zig build run-hello-zaza |
| Package producer / consumer | zig build package-consumer-run |
| Mixed C + C++ + Zig | zig build mixed-stack-run |
| Interface + object + static graph | zig build interface-object-graph-run |
| Shared plugin loading | zig build shared-plugin-run |
| Cross-compile artifact report | zig build cross-compile-cli-report |
| C++20 modules | zig build cxx20-modules-run |
| WASI artifact validation | zig build wasm-wasi-report |
| Host-loaded wasm exports | zig build wasm-exports-run |
| Browser wasm demo | zig build wasm-web-demo-smoke |
Full per-example explanations and diagrams live in docs/EXAMPLES.md.
The intent is not to mimic CMake syntax one-for-one. The intent is to cover the workflows people actually need when starting new projects.
| CMake concept | Zaza shape |
|---|---|
CMakeLists.txt |
build.zig |
add_executable() |
executable target / CppExample{ .kind = .executable } |
add_library(STATIC ...) |
CppExample{ .kind = .static_library } |
target_include_directories() |
include-dir fields on the target |
target_compile_definitions() |
public_defines / private_defines / config defines |
add_custom_command() |
custom_commands |
install() / export() |
install/export fields and Zaza package metadata |
find_package() consumer flow |
package producer / consumer example |
See docs/CMAKE_PARITY.md and docs/ROADMAP.md for the full parity framing.
Zaza has concrete wasm workflows:
zig build wasm-wasi-report
zig build wasm-exports-run
zig build wasm-web-demo
zig build wasm-web-demo-smoke
zig build wasm-web-demo-servewasm-web-demo-serve stages and serves a browser harness at http://127.0.0.1:8000.
- Mixed C/C++/Zig target graphs
- Package producer/consumer workflow
- WebAssembly (WASI, host embedding, browser)
- CMake interop layer
- Verified example matrix
- Polished public API
- Registry and package discovery
- IDE integration (language server, VS Code extension)
See the open issues for a full list of proposed features (and known issues). See docs/ROADMAP.md for the detailed roadmap.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
The current contribution bar is:
zig build test
zig build example-matrixIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
See CONTRIBUTING.md for the full repo workflow details.
Distributed under the MIT License. See LICENSE for more information.
Abhishek Shivakumar - security@zaza.build
Project Link: https://github.com/godofecht/zaza
- Zig - the language and build system that makes this possible
- Best-README-Template - README template
- All contributors and the open source community
| Path | Purpose |
|---|---|
build.zig |
Root build graph |
build_lib |
Reusable build helpers |
examples |
Example projects and workflows |
tests |
Zig-side test coverage |
registry |
Lightweight registry metadata |
wiki |
Static docs site |
docs |
Documentation |