Skip to content

pcons v0.22.0.dev32 (e37e2b6, 2026-07-25)

A Python-based build system that generates Ninja build files.

  • Zero install - Run directly with uvx pcons (requires only uv)
  • Pure Python - Your build script is just Python. No DSL to learn.
  • Fast builds - Generates Ninja files for parallel builds with proper dependency tracking.
  • Extensible - Create custom tools for any build step.

Quick Start

1. Create hello.c:

#include <stdio.h>
int main() { printf("Hello, world!\n"); return 0; }

2. Create pcons-build.py:

from pcons import Project

project = Project("hello", build_dir="build")
env = project.Environment(toolchain="c")

hello = project.Program("hello", env, sources=["hello.c"])

3. Build and run:

uvx pcons
./build/hello

That's it. No installation, no configuration files, no build directory setup.

Instead of uv, you can use pipx or just python -mpip install pcons to install.

Next Steps

See the User Guide for:

  • CLI options (variants, variables, reconfiguration)
  • Multi-file projects with include paths
  • Shared libraries and installation
  • Creating custom tools
  • API reference

Porting an existing CMake project? See the CMake to Pcons Porting Guide.