Skip to content

Using Meson

A practical introduction to configuring and building software with Meson.

This English edition retains the original diagrams and examples for direct use.

Commands and examples

sudo apt-get install meson
meson setup builddir --prefix=/path/to/install
meson compile -C builddir
meson install -C builddir
meson setup --reconfigure builddir --prefix=/new/path
meson setup builddir --prefix=/home/user/custom_install
meson setup builddir --buildtype=release
export CC='ccache gcc'
     export CXX='ccache g++'
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'armv7'
endian = 'little'

[binaries]
c = '/path/to/arm-linux-gnueabihf-gcc'
cpp = '/path/to/arm-linux-gnueabihf-g++'
pkgconfig = '/path/to/arm-linux-gnueabihf-pkg-config'

Practical notes

Adapt the commands and configuration to the version, distribution, and target hardware being used.