{"library":"meson","title":"Meson Build System","description":"Meson is a high-performance, cross-platform build system designed to be both extremely fast and user-friendly. It supports numerous programming languages (C, C++, Rust, Fortran, Java, Python, etc.) and compilers, using a simple, non-Turing complete domain-specific language (DSL) for defining builds. The project aims for a major release approximately every 3-4 months, with bugfix releases in between.","status":"active","version":"1.10.2","language":"en","source_language":"en","source_url":"https://github.com/mesonbuild/meson","tags":["build system","compilation","project management","c","c++","rust","fortran","python","cross-platform"],"install":[{"cmd":"pip install meson","lang":"bash","label":"Install using pip"},{"cmd":"sudo apt-get install python3 ninja-build meson","lang":"bash","label":"Debian/Ubuntu (may be outdated)"}],"dependencies":[{"reason":"Meson is implemented in Python and requires Python 3.7+ to run. It avoids external Python dependencies beyond the standard library.","package":"python","optional":false},{"reason":"Ninja is the default and recommended backend for Meson, used for the actual compilation.","package":"ninja","optional":true}],"imports":[{"note":"Meson build files use their own DSL. While Meson is written in Python, direct programmatic use of the 'meson' Python package as a library is not the primary way to interact with the build system for end-user projects. For Python package integration, `meson-python` is the recommended PEP 517 backend.","symbol":"Meson DSL","correct":"Meson is primarily used via its command-line interface and build definition files (e.g., meson.build), not typically through direct Python imports for general build orchestration. Python modules within Meson's DSL are imported using the `import()` function (e.g., `python = import('python')`)."}],"quickstart":{"code":"mkdir myproject\ncd myproject\necho '#include <stdio.h>\\nint main() { printf(\"Hello from Meson!\\n\"); return 0; }' > main.c\necho \"project('hello_meson', 'c')\\nexecutable('hello', 'main.c', install: true)\" > meson.build\n\nmeson setup builddir\nmeson compile -C builddir\n./builddir/hello\nmeson install -C builddir","lang":"bash","description":"This quickstart demonstrates how to create a simple C 'Hello World' project with Meson. It involves defining the project and an executable in `meson.build`, configuring the build directory, compiling the project, running the executable, and finally installing it. Meson enforces out-of-source builds, meaning all build artifacts are placed in a separate build directory (e.g., `builddir`)."},"warnings":[{"fix":"Use `meson.current_source_dir()`, `meson.current_build_dir()`, `meson.project_source_root()`, or `meson.project_build_root()` instead, which provide better subproject isolation.","message":"The `meson.build_root()` and `meson.source_root()` functions are deprecated as they often cause issues in subprojects by pointing to the parent project's root.","severity":"deprecated","affected_versions":">=0.56.0"},{"fix":"Pass explicit boolean values (`true` or `false`) to `option()` for boolean types.","message":"Coercing string values (e.g., `'false'`) to boolean types in the `option()` function is deprecated and will result in a warning.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Rename tests to avoid colons in their names.","message":"Using a colon (':') in test names is deprecated and will be replaced with an underscore ('_') internally, to avoid conflicts with the `subproject:testname` syntax for running subproject-specific tests.","severity":"breaking","affected_versions":">=0.56.0"},{"fix":"Commit all changes before running `meson dist`, or explicitly use the `--allow-dirty` command-line option if you intend to create a distribution from a dirty working tree.","message":"The `meson dist` command will error if the Git repository contains uncommitted changes. This is a stricter behavior to prevent accidental releases of non-committed code.","severity":"gotcha","affected_versions":">=0.62.0"},{"fix":"Projects relying on specific legacy library naming should be aware of the `namingscheme` option. Consider explicitly setting `namingscheme: 'legacy'` in your `project()` call if you depend on old behavior, or adapt to `platform` naming.","message":"Meson 1.10.0 introduced a 'platform' naming scheme for libraries, which will eventually become the default, potentially altering library filenames (e.g., on Windows, static libraries might change from `.a` to `.lib`, and import libraries from `.lib` to `.dll.lib`).","severity":"breaking","affected_versions":">=1.10.0 (future default change)"},{"fix":"This is an ongoing issue reported in the Meson GitHub repository. No direct fix for users at this time, but awareness is key for debugging slow configure times.","message":"Performance regression in `pkg-config` dependency lookup in Meson 1.10.0, potentially making `meson setup` significantly slower for projects with many `pkg-config` dependencies due to new linkability checks.","severity":"gotcha","affected_versions":">=1.10.0"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}