Skip to content

godofecht/zaza

Contributors Forks Stargazers Issues MIT License


Zaza

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Example Highlights
  5. Replacing CMake
  6. WebAssembly
  7. Roadmap
  8. Contributing
  9. License
  10. Contact
  11. Acknowledgments

About The Project

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.

(back to top)

Built With

  • Zig
  • C / C++
  • CMake (interop layer)
  • WebAssembly

(back to top)

Getting Started

Prerequisites

  • Zig 0.14.0 or newer
  • Git (for dependency fetch flows)
  • Optional: direnv for repo-local cache setup

Installation

  1. Clone the repo
    git clone https://github.com/godofecht/zaza.git
  2. Enter the project directory
    cd zaza
  3. (Optional) Allow direnv
    direnv allow
  4. Verify the build
    zig build test
    zig build example-matrix

(back to top)

Usage

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-serve

If a target needs external tools such as git or cmake, enable them explicitly:

ZAZA_SYSTEM_CMDS=1 zig build cmake-shim

Naming 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.

(back to top)

Example Highlights

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.

(back to top)

Replacing CMake

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.

(back to top)

WebAssembly

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-serve

wasm-web-demo-serve stages and serves a browser harness at http://127.0.0.1:8000.

(back to top)

Roadmap

  • 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.

(back to top)

Contributing

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-matrix

If 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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for the full repo workflow details.

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Abhishek Shivakumar - security@zaza.build

Project Link: https://github.com/godofecht/zaza

(back to top)

Acknowledgments

  • Zig - the language and build system that makes this possible
  • Best-README-Template - README template
  • All contributors and the open source community

(back to top)

Repository Layout

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

(back to top)

About

A Zig-driven build system for modern C, C++, Zig, CMake-interop, and WebAssembly workflows.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors