Meson
Purpose
Guide agents through Meson project setup, build configuration, the wrap dependency system, and cross-compilation — covering the build system used by GLib, systemd, GStreamer, Mesa, and many major C/C++ projects.
Triggers
- "How do I set up a Meson build?"
- "How do I add a dependency in Meson?"
- "How do I cross-compile with Meson?"
- "Meson wrap isn't finding my dependency"
- "How do I configure build options in Meson?"
- "How do I migrate from CMake/Autotools to Meson?"
Workflow
1. Project setup
2. Build and test
3. meson.build structure
4. Dependency management with wrap
In meson.build:
subprojects/zlib.wrap structure:
5. Build options
Define in meson_options.txt (or meson.options in Meson ≥1.1):
Use in meson.build:
6. Cross-compilation
Create a cross file (cross/arm-linux.ini):
7. CMake migration cheatsheet
For wrap patterns and subproject configuration, see references/meson-wrap.md [blocked].
Related skills
- Use
skills/build-systems/cmakewhen CMake is required or preferred - Use
skills/build-systems/ninja— Meson uses Ninja as its backend - Use
skills/compilers/cross-gccfor cross-compiler toolchain setup - Use
skills/compilers/gccorskills/compilers/clangfor compiler flag context


