embargo

Crates.ioembargo
lib.rsembargo
version0.1.1
sourcesrc
created_at2023-03-24 12:34:30.504256
updated_at2023-05-01 18:35:25.605346
descriptionA simple and fast opinionated build system for c/c++
homepage
repositoryhttps://github.com/Valchap/embargo
max_upload_size
id819279
size72,360
Valchap (Valchap)

documentation

README

Embargo

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

Usage

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

Configuration

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

Alternatives

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

Commit count: 20

cargo fmt