caxe-0.3.1 is not a library.
caxe (cx) ๐ช
caxe (pronounced "c-axe") is a modern project manager for C and C++ designed to cut through the complexity of legacy build systems.
It provides a unified workflow for scaffolding, building, testing, formatting, and managing dependenciesโgiving C/C++ developers the modern experience they deserve.
Zero Configuration. Lightning Fast. Batteries Included.
โจ Features
- โก Zero Config Start: Create a Hello World C/C++ project in seconds.
- ๐ง Automatic Toolchain Discovery: Detects MSVC, Clang-CL, Clang++, and GCC without relying on PATH. Uses
vswhereon Windows. - ๐ฆ Smart Dependency Management:
- Git Libraries: Auto-download from GitHub. Supports Pinning (Tag/Branch/Commit) for stability.
- System Packages: Native support for
pkg-config(e.g., GTK, OpenSSL). - Vendor Mode:
cx vendorto copy dependencies locally for offline builds.
- ๐ High-Performance Builds:
- Lock-free Parallel Compilation: Utilizes all CPU cores.
- Caching: CCache integration, incremental builds, and PCH support.
- LTO: Link Time Optimization for release builds.
- ๐งช Smart Testing:
- Auto-links project sources for unit testing internals.
- Test filtering (
--filter) and binary caching.
- ๐ Insights:
cx statsfor code metrics andcx treefor dependency graphs. - ๐ WebAssembly:
cx build --wasm(via Emscripten) support out of the box. - ๐ก๏ธ Safety:
cx build --sanitizefor Address/Undefined Behavior sanitizers. - ๐จ Code Formatting: Built-in
cx fmtcommand (viaclang-format). - ๐ค Automation: Generators for Docker, GitHub Actions, and VSCode configs.
๐ฆ Installation
Automatic Script (Recommended)
Windows (PowerShell):
iwr https://raw.githubusercontent.com/dhimasardinata/caxe/main/install.ps1 -useb | iex
Unix (Linux/macOS):
|
Option 2: Install via Cargo
๐ Quick Start
Interactive Mode
Simply run cx or cx new without given name to start the wizard.
# ? What is your project name? โบ my-app
# ? Select a template: โบ console
# ? Select language: โบ cpp
CLI Arguments Mode
# Default (Hello World)
# Web Server (cpp-httplib)
# Raylib Game Config
๐ CLI Reference
Project Management
cx new <name>: Create a new project.cx init: Initializecx.tomlin an existing directory (imports CMake/Makefile projects!).cx info: Show system, cache, and toolchain info.cx doctor: Diagnose system issues (missing tools, compilers).cx stats: Show project code metrics (LOC, files).
Build & Run
cx run: Build and run the project.cx build: Compile only.--release: Optimize for speed (-O3//O2).--wasm: Compile to WebAssembly (requires Emscripten).--lto: Enable Link Time Optimization.--sanitize=<check>: Enable runtime sanitizers (e.g.,address,undefined).--profile: Trace build times (generate chrome tracing.json).
cx watch: Rebuild on file save.cx clean: Remove build artifacts.
Dependencies
cx add <lib>: Add a library from registry or Git URL.cx remove <lib>: Remove a dependency.cx update: Update dependencies to latest versions.cx vendor: Copy all dependencies intovendor/for commit/offline use.cx tree: Visualize the dependency graph.
Testing & Quality
cx test: Run unit tests intests/.--filter <name>: Run specific tests.
cx fmt: Format code withclang-format.cx check: Static analysis (clang-tidy/cppcheck).
Ecosystem
cx docker: Generate a Dockerfile.cx ci: Generate a GitHub Actions workflow.cx setup-ide: Generate VSCode configuration (.vscode/).
โ๏ธ Configuration (cx.toml)
[]
= "my-awesome-app"
= "0.1.0"
= "c++20"
[]
= "app" # Output: app.exe
= "clang" # Options: msvc, clang, clang-cl, g++
= ["-O2", "-Wall", "-Wextra"]
= ["pthread", "m"]
= "src/pch.hpp" # Precompiled Header (Optional)
[]
# 1. Simple Git (HEAD)
= "https://github.com/fmtlib/fmt.git"
# 2. Pinned Version (Recommended for production)
= { = "https://github.com/nlohmann/json.git", = "v3.11.2" }
# 3. System Dependency (pkg-config)
= { = "gtk4" }
๐ License
MIT