build#

Configure (if needed) and build the project.

clibra build --preset debug

On first run, clibra detects that no build directory exists and runs the configure step automatically. Subsequent runs skip configure unless inputs have changed. CMake’s internal re-run mechanism handles incremental reconfigures transparently.

CMake equivalent#

Cold start (no build directory):

cmake --preset <n> [-D VAR=VALUE ...]
cmake --build --preset <n> --parallel <N>

Incremental:

cmake --build --preset <n> --parallel <N> [--clean-first] [--keep-going]

Situation

What clibra build does

Build directory absent

Runs configure, then build.

Build directory present, inputs unchanged

Runs build only.

Build directory present, --reconfigure given

Always runs configure, then build.

--fresh given

Runs cmake --fresh --preset <n> then build.

--clean given

Runs build with --clean-first; does not reconfigure.

Flag reference#

clibra build#

Configure (if needed) and build the project

Usage: clibra build [OPTIONS]

Options:#

  • -j, --jobs <JOBS> — Parallel job count. Defaults to the # of logical CPUs

    Default value: 4

  • -t, --target <TARGET> — Build a specific CMake target

  • --clean — Pass –clean-first to cmake –build

  • -k, --keep-going — Continue building after errors. Only valid with {Ninja, Unix Makefiles} generators

  • -D <VAR=VALUE> — Forward -DVAR=VALUE to the CMake configure step when active. If the build directory exists and neither –reconfigure nor –fresh is given, abort

  • -r, --reconfigure — Force the configure step even if the build directory exists

  • -f, --fresh — Reconfigure with a –fresh build directory by wiping the CMake cache

  • -v, --verbose — Run the build in verbose mode, printing build commands