Skip to main content

Meson Build Options

Configure options are set via meson setup or meson configure.

Ant-Specific Options

OptionTypeDefaultDescription
static_linkbooleanfalseStatically link the final binary
build_timestampstring(auto)Build timestamp (defaults to current time)
tls_librarycomboopensslTLS backend: openssl or mbedtls
deps_prefix_cmakestring(empty)Prefix path for cmake dependency lookup

Standard Meson Options

Standard Meson built-in options used by Ant:
OptionDefaultDescription
buildtypereleaseBuild type (release, debug, etc.)
optimization3Optimization level (0-3)
c_stdgnu23C language standard
b_ltotrueLink-time optimization
b_lto_threads8LTO parallelism
striptrueStrip debug symbols from binary
b_sanitizenoneSanitizer (e.g. address)

Example Usage

To build with mbedTLS and static linking:
meson setup build -Dtls_library=mbedtls -Dstatic_link=true --prefer-static
To build with debug symbols and no optimization:
meson setup build --buildtype=debug -Doptimization=0 -Db_lto=false -Dstrip=false

TLS Library Selection

Ant supports two TLS backends:
  • OpenSSL (default): Widely available, used on all platforms by default.
  • mbedTLS: Lighter alternative, useful for embedded or constrained environments. Currently only tested on macOS CI.

Building with OpenSSL

OpenSSL is the default TLS backend:
meson setup build
Or explicitly specify:
meson setup build -Dtls_library=openssl

Building with mbedTLS

To build with mbedTLS:
meson setup build -Dtls_library=mbedtls
When using mbedTLS, the target triple in the version string will include -mbedtls as a suffix.

Common Build Configurations

Static Build

For a fully static build (useful for Alpine/musl):
meson setup build -Dstatic_link=true --prefer-static

Debug Build

For debugging with symbols:
meson setup build --wipe --buildtype=debug \
  -Doptimization=0 -Db_lto=false -Dstrip=false -Db_lundef=false -Dunity=off

ASan Build

For memory debugging with AddressSanitizer:
meson setup build --wipe \
  -Db_sanitize=address -Doptimization=0 -Db_lto=false -Dstrip=false -Db_lundef=false

Fast Iteration Build

For fast rebuilds during development:
meson setup build -Db_lto=false -Doptimization=2

Build docs developers (and LLMs) love