What it is: Pcons is a build system where Python scripts describe what to build, and Ninja (or Make) executes it. There's no custom DSL — your build files are real Python with full IDE support, debugging, and testing. The core is completely language-agnostic: it knows nothing about compilers or C++. All tool-specific knowledge lives in pluggable toolchains and tools, so building LaTeX documents or game assets should be as natural as building C++.
How it's different from SCons: Pcons doesn't execute builds itself. It generates Ninja files, so incremental builds are fast and you get Ninja's parallelism for free. Environments use namespaced tools (env.cc.flags, env.cxx.flags, env.link.libs) instead of flat variables, eliminating the CFLAGS vs CXXFLAGS confusion. Targets have CMake-style usage requirements (target.public.include_dirs, target.public.link_libs) that propagate transitively through the dependency graph. And unlike SCons, unknown variables are errors, not silent empty strings.
How it's different from CMake: No DSL to learn — it's just Python. Variable substitution is recursive and explicit. The builder/toolchain system is fully extensible, so third-party builders are first-class citizens. And you can use it as `uvx pcons` for true zero-install (great for other open source projects).
Major features as of v0.7:
- Toolchains for GCC, LLVM/Clang, MSVC, and clang-cl with auto-detection (including
- Generators for Ninja, Makefile, Xcode, compile_commands.json, and Mermaid/DOT dependency diagrams
- Package management via pkg-config, Conan 2.x, and a pcons-fetch tool for building dependencies from source
- Compiler cache support (ccache/sccache), semantic presets (warnings, sanitizers, LTO, hardening), cross-compilation presets (Android NDK, iOS, WebAssembly)
- Platform-specific helpers: macOS bundles/frameworks/.pkg/.dmg, Windows manifests/MSIX, and an msvcup module for installing MSVC without Visual Studio
- An extensible module/add-on system for domain-specific tasks
- Debug tracing (--debug=resolve,subst) with source-location tracking on every node
- Plenty of examples included, unit tests for all features, tested on Mac, Windows and Linux It's still under active development — ready for experimentation, not production unless you're brave. I'd love bug reports, feedback on the API design and what you'd want from a modern Python-based software build system.
Open source, MIT licensed.GitHub: https://github.com/DarkStarSystems/pcons | Docs: https://pcons.readthedocs.io | PyPI: `uvx pcons` or `pip install pcons`