Skip to main content

CMake-compatible build system that generates Ninja build files

Project description

cja

A CMake-compatible build system that generates Ninja build files.

Build a project with a CMakeLists.txt using:

cja
ninja

This is equivalent to the following with CMake:

cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_COLOR_DIAGNOSTICS=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=1
ninja -Cbuild

Install

pip install cja

Or, if you're in a managed Python environment:

pipx install cja

Comparison to CMake

  • The build.ninja file is generated in your project root, not in the build directory. To allow multiple build configurations in parallel, the file name is <builddir>.ninja.
  • Paths are relative to the project root, while CMake uses absolute paths. This is faster, reduces output, and also reduces binary size as paths (e.g. for debug symbols) are shorter. When reading output from a Docker container, this lets you click paths and open the correct files in your local editor.
  • Instead of a separate tool like CTest, cja generates a phony test target that runs all tests as part of the Ninja build graph, so tests can start as soon as the first test binary is ready.
  • Colors for compiler diagnostics are enabled by default.
  • _builddir_/compile_commands.json is always generated.
  • More colorful, simplified output. For example, when downloading dependencies, cja shows progress bars using Rich, while CMake shows no output (or simple multi-line output when -DFETCHCONTENT_QUIET=0 is specified).

Limitations to keep cja simple:

  • Only generates Ninja build files.
  • Out-of-tree builds aren't allowed.
  • Only supports Linux, macOS, and Windows.
  • Only supports clang with a GNU-like command line on Windows.

Build Subcommand

cja supports a build subcommand, which runs ninja automatically afterward.

cja build --release

Equivalent to calling:

cja -Bbuild-release -DCMAKE_BUILD_TYPE=Release
ninja -f build-release.ninja

Run Subcommand

cja also generates a run phony target that executes the first executable (or the one set via VS_STARTUP_PROJECT) in your CMakeLists.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cja-0.2.0.tar.gz (59.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cja-0.2.0-py3-none-any.whl (64.6 kB view details)

Uploaded Python 3

File details

Details for the file cja-0.2.0.tar.gz.

File metadata

  • Download URL: cja-0.2.0.tar.gz
  • Upload date:
  • Size: 59.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cja-0.2.0.tar.gz
Algorithm Hash digest
SHA256 026b28f4327b209a364416b6fa3d46549fbbcb59a41ea133d249978dc6241833
MD5 a177b91ea2e43ab15b09ddbb1d35973a
BLAKE2b-256 b59a0852d952c68b2e06b5864b09fc6cb34b8a1666a522fae5a79934b9cee852

See more details on using hashes here.

Provenance

The following attestation bundles were made for cja-0.2.0.tar.gz:

Publisher: release.yml on jhasse/cja

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cja-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cja-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 64.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cja-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e828833ad013e700bfbc2e55ff6992c91fc40f1d13541d8bd294952e2f09fc2e
MD5 e8a97818c9a597f4e7e7002c4c4b11cf
BLAKE2b-256 1fd5646190daf6103b5456999d7388eb0d0c1de32f6a8f0d0a3b53b171700c18

See more details on using hashes here.

Provenance

The following attestation bundles were made for cja-0.2.0-py3-none-any.whl:

Publisher: release.yml on jhasse/cja

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page