#build-system #cpp #build-tool #c

build embargo

A simple and fast opinionated build system for c/c++

3 unstable releases

0.1.1 May 1, 2023
0.1.0 Apr 2, 2023
0.0.1 Mar 24, 2023

#328 in Build Utils

Download history 5/week @ 2024-02-15 28/week @ 2024-02-22 1/week @ 2024-02-29 7/week @ 2024-03-07 27/week @ 2024-03-14 26/week @ 2024-03-28 26/week @ 2024-04-04

52 downloads per month

GPL-3.0 license

580 lines


Embargo is a simple and fast opinionated build system for c/c++

Install or update

Install rust

Then install embargo with rust package manager :

cargo install embargo

Embargo uses the llvm toolchain by default (clang, lldb, clang-tidy)

Debian dependencies :

apt install clang lldb clang-tidy


Create a new project

First create a project folder, then type the following command inside it:

embargo init

This will create a default "Hello World"

Build your app

Debug build :

embargo build

Release build :

embargo release-build

Builds can be found in the build/debug or build/release folder

Run your app

Debug run :

embargo run

Release run :

embargo release-run

Embargo will build your app before running it so that you always run the latest version of your app

embargo run runs your app inside a debugger so that you can easily find where a crash happened in your code.

Debug your app

embargo debug

This will start the debugger with your app attached to it

Lint your app

embargo lint

This will use clang-tidy to find common mistakes in your code

Generate clangd configuration

embargo clangd-config

This will create the compile_flags.txt that can the be used by the clangd language server

Clean build folder

embargo clean

This will remove the build folder

Show configuration

embargo show-config

This will show Embargo configuration for the current project


Embargo project configuration is read from the Embargo.toml file at the root of your project

Here is an example configuration with Embargo default settings

compiler = "clang++"
debugger = "lldb"
linter = "clang-tidy"
flags = ["-Wall", "-Wextra", "-pedantic"]
debug-flags = ["-g"]
release-flags = ["-O2"]
linker-flags = []
linter-checks = ["clang-analyzer-*"]

If a key is missing in the configuration Embargo will use these as default settings


If you don't want to install the rust toolchain, but still want similar functionality, you may have a look at PyBargo


~89K SLoC