meson
Meson build system skill for C/C++ projects. Use when setting up a Meson project, configuring build options, managing dependencies with the wrap system, cross-compiling, or integrating Meson with CI. Activates on queries about meson setup, meson compile, meson wrap, meson test, cross-file, meson.bui
By mohitmishra786 · 439 installs
npx skills add mohitmishra786/low-level-dev-skills --skill meson
Source repository · Upstream listing
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
buildtype Equivalent flags
debug (default) O0 g
debugoptimized O2 g
release O3 DNDEBUG
minsize Os DNDEBUG
plain No flags added
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
CMake Meson equivalent
add executable executable()
add library library() / static library() / shared library()
target include directories include directories arg in target
target link libraries dependencies / link with
find package dependency()
option() option() in meson options.txt
add subdirectory subdir()
install(TARGETS ...) install : true in target
For wrap patterns and subproject configuration, see [references/meson wrap.md](references/meson wrap.md).
Related skills
Use skills/build systems/cmake when CMake is required or preferred
Use skills/build systems/ninja — Meson uses Ninja as its backend
Use skills/compilers/cross gcc for cross compiler toolchain setup
Use skills/compilers/gcc or skills/compilers/clang for compiler flag context