49 GPLv3

A Cargo-style build tool for C and C++.

Build, run, and test C and C++ projects from a single dcr.toml, with dependencies managed for you. No Makefiles, no CMake scripts. Just dcr new, dcr build, and dcr run.

Terminal

$ dcr new myapp

Creating project `myapp` Created directory `myapp` Created dcr.toml Created src/main.c Initialized git repository Created project `myapp` info: Next steps: cd myapp dcr run

$ cd myapp

$ dcr run

project myapp (debug, x86_64-unknown-linux-gnu) compile myapp v0.1.0 [1/1] done in 0.24s run /home/dexoron/tmp/myapp/target/x86_64-unknown-linux-gnu/debug/myapp Hello World!

$

Features

Everything you need to build C and C++.One tool, one config, one workflow.

Simple commands

new, build, run, test, clean, add, fmt, lint: the whole workflow in one tool.

Path, Git, registry, and system dependencies

Use libraries from a local folder, a Git repository, a registry, or the system via pkg-config. dcr.lock records exactly what was resolved, including the Git commit.

Cross-compilation

Build for another OS or architecture from the same project. Set the target with a full target triple or a short name like windows.

Works with your IDE

dcr gen produces compile_commands.json and ready-made VS Code and CLion configs, so you can keep your editor.

One project file

Name, language, standard, compiler, and dependencies all live in dcr.toml, not scattered across scripts.

Built-in help

Every command has --help, and package installs include man pages such as man dcr-build.

Quick Start

Create and run a C or C++ project in three steps.

Create a project

dcr new sets up a project with a dcr.toml and a ready-to-build src/main.c.

Terminal

$ dcr new myapp

Creating project `myapp` Created project `myapp` info: Next steps: cd myapp dcr run

$ cd myapp

Configure

Describe the project in one short, readable TOML file. No CMake syntax required.

nvim dcr.toml

[package] name = "myapp" version = "0.1.0" dcr-version = "0.9.6" [build] language = "c" standard = "c11" compiler = "clang" kind = "bin" [dependencies]

Build and run

dcr run builds the project and its dependencies, then runs the result.

Terminal

$ dcr run

project myapp (debug, x86_64-unknown-linux-gnu) compile myapp v0.1.0 [1/1] done in 0.24s run /home/user/myapp/target/x86_64-unknown-linux-gnu/debug/myapp Hello World!

Need custom compiler flags, Qt support, or a bare-metal build?

Read the documentation

Download

Install DCR with a single command.

curl -fsSL https://sh.dcr-tool.ru | sh

Then verify:

dcr --version

The installer also sets up dcrup, a version manager for DCR.