Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

meson

> 编程语言
Open source

The Meson Build System

6.6K stars0 likes2 views
WebsiteGitHub

About

The Meson Build System

Meson® is a project to create the best possible next-generation build system.

Status

Dependencies

  • Python (version 3.10 or newer)
  • Ninja (version 1.8.2 or newer)

Latest Meson version supporting previous Python versions:

  • Python 3.9: 1.11
  • Python 3.8: 1.11
  • Python 3.7: 1.11
  • Python 3.6: 0.61.5
  • Python 3.5: 0.56.2
  • Python 3.4: 0.45.1

Installing from source

Meson is available on PyPI, so it can be installed with pip3 install meson. The exact command to type to install with pip can vary between systems, be sure to use the Python 3 version of pip.

If you wish you can install it locally with the standard Python command:

bash
python3 -m pip install meson

For builds using Ninja, Ninja can be downloaded directly from Ninja GitHub release page or via PyPI

bash
python3 -m pip install ninja

More on Installing Meson build can be found at the getting meson page.

Creating a standalone script

Meson can be run as a Python zip app. To generate the executable run the following command:

./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' <source checkout>

Running

Meson requires that you have a source directory and a build directory and that these two are different. In your source root must exist a file called meson.build. To generate the build system run this command:

meson setup <source directory> <build directory>

Depending on how you obtained Meson the command might also be called meson.py instead of plain meson. In the rest of this document we are going to use the latter form.

You can omit either of the two directories, and Meson will substitute the current directory and autodetect what you mean. This allows you to do things like this:

bash
cd <source root>
meson setup builddir

To compile, cd into your build directory and type ninja. To run unit tests, type ninja test.

More on running Meson build system commands can be found at the running meson page or by typing meson --help.

Contributing

We love code contributions. See the contribution page on the website for details.

IRC

The channel to use is #mesonbuild either via Matrix (web interface) or OFTC IRC.

Further info

More information about the Meson build system can be found at the project's home page.

Meson is a registered trademark of Jussi Pakkanen.

Issues· 2244 open

View all issuesOpen on GitHub
  • #15470

    cannot use Boost headers-only libraries if no runtime library is installed

    dependenciesboostUpdated Sep 23, 2026
  • #16225

    Using 'false' in install_mode argument changed behavior from meson 1.0.1 to 1.4.1

    Updated Sep 22, 2026
  • #15597

    jar target is always dirty if path to source does not match package.

    language:javaneeds-infoUpdated Sep 22, 2026
  • #16032

    Support other linkers on MacOS

    enhancementOS:macosdynamic linkersUpdated Sep 21, 2026
  • #16205

    Deprecate passing an argument to `import('python').find_installation()`

    Updated Sep 20, 2026
  • #16217

    MSVC/Ninja: b_pgo=generate inserts /link before source files

    Updated Sep 18, 2026
  • #15924

    Tracker for typing/refactoring ideas

    Updated Sep 15, 2026
  • #15865

    meson introspect --dependencies no longer returns declare_dependency() deps

    introspectionUpdated Sep 14, 2026
  • #14369

    Building rust libstd with Meson

    language:rustdependencies:cargoUpdated Sep 12, 2026
  • #15454

    Passing of source-path between libraries

    Updated Sep 11, 2026

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言