Building¶
Prerequisites¶
a C compiler (Clang or GCC),
CMake >= 3.16,
Ninja,
git (the build fetches the JSMN JSON parser via CMake
FetchContent).
No other third-party runtime dependency is required.
Local build¶
make build # configure + build + install into build/fs
make build_run # build, then run the example
make test # build with unit tests and run them (ctest)
make build_asan # build with Address + UB sanitizers
The binary is installed to build/fs/bin/delta. Under the hood make build
calls tools/run_make.sh, which configures CMake with Ninja and installs into
build/fs.
Cross-platform native builds¶
tools/run_make.sh selects a toolchain per target (downloaded on demand) and
builds into a per-target folder:
./tools/run_make.sh # native Linux / macOS
./tools/run_make.sh --win32 # Windows (llvm-mingw)
./tools/run_make.sh --mac-arm64 # macOS arm64 (osxcross from Linux)
./tools/run_make.sh --mac-x86_64 # macOS x86_64
For static musl Linux binaries and the full Docker cross matrix (x86_64 / aarch64 / armv7 / riscv64 / mips), see Cross-compilation. For minimal-size and feature-trimmed builds, see Build- & run-time features.
Versioning¶
The version is the last git tag reachable from HEAD — nothing is stored
in the tree, so a release is cut by tagging and nothing has to be bumped by
hand:
./tools/get_version.sh # 0.0.3 (the tag; a leading "v" is stripped)
./tools/get_version.sh full # 0.0.3-d3fe5e7 (tag + short commit hash)
./tools/get_version.sh major # one component of the tag
CMake reads the same tag, so delta --version and the version field of
the JSON report always match what the scripts and CI artifacts report. A tree
without git history (exported tarball, shallow clone with no tags) falls back
to 0.0.0.
CI¶
The Jenkinsfile builds all native platforms plus the static musl matrix in
parallel and publishes the artifacts; documentation is generated with
tools/generate_doc.sh.