The Meson Build System

Andrei Alexeyev 26b1c21172 coredata: refactor options to remember their names 1 年之前
.github 9074ad93c6 build: harden workflow permissions 1 年之前
ci 68a84f6535 fix confusing azure pipelines status for coverage 1 年之前
cross 1521bdd9fd CI: install ifort on Windows 2 年之前
data 99dfc988eb Use meson setup [options] in meson RPM macro 1 年之前
docs a6d088ba3d Created release note page for 1.0.0. 1 年之前
graphics 011c77ee22 New logo and license text. Closes #4921. [skip ci] 5 年之前
man c8766468a3 Bump version numbers for rc1. 1 年之前
manual tests 72e0a95f7f Add stable regression test 1 年之前
mesonbuild 26b1c21172 coredata: refactor options to remember their names 1 年之前
packaging 3e26c0f1ca Add optional compress 2 年之前
test cases 26b1c21172 coredata: refactor options to remember their names 1 年之前
tools 7229443738 docs: only list the latest build of a given stable tag for each wrapdb entry 2 年之前
unittests 35e230e48c depfixer: silence fix_jar() and make it do something 1 年之前
.editorconfig 173a40be33 editorconfig settings: attempt to guarantee the final end-of-line char 3 年之前
.flake8 2dfd952eb9 Move classes used by scripts to their own module 2 年之前
.gitattributes d505a68e34 Fix crlf line endings 5 年之前
.gitignore 765aff5a42 coverage: Enable coverage reports 3 年之前
.mailmap d3fd050f85 mailmap: add alias for myself 2 年之前
.mypy.ini b57a355426 typing: use follow_imports = silent 4 年之前
.pylintrc 2d349eae8c pylint: enable the set_membership plugin 1 年之前
CODEOWNERS 5a4177523e modules/wayland: Add unstable_wayland module 2 年之前
COPYING a428c953ff Start of project. 11 年之前
MANIFEST.in 081f3b3545 remove outdated reference to deleted files in setuptools packaging 2 年之前
README.md 08b9829256 LGTM is discontinued. Remove badge and config 1 年之前
azure-pipelines.yml 68a84f6535 fix confusing azure pipelines status for coverage 1 年之前
contributing.md 7561926a70 Readme fixes. [skip ci] 5 年之前
meson.py 2dfd952eb9 Move classes used by scripts to their own module 2 年之前
pyproject.toml d2d9df3121 setup.py: better requirements 2 年之前
run_cross_test.py 3e396b3782 fix: Always explicitly set encoding for text files (fixes #8263) 3 年之前
run_format_tests.py 636bf91586 CI: Split out file format test as a separate GitHub workflow 3 年之前
run_meson_command_tests.py 908a78dbc2 tests: make the command tests work when python is not the one in the shebang 1 年之前
run_mypy.py 0b7d935a84 target python 3.10 as the mypy language version 1 年之前
run_project_tests.py 71cddebf2c Enable Java project tests on Darwim 1 年之前
run_single_test.py 48709dd2ea run_single_test: Allow passing extra args like run_project_test 2 年之前
run_tests.py 608a6196a0 python 3.11: suppress an incorrect EncodingWarning 1 年之前
run_unittests.py d37002a5f5 run_unittests: check for pytest and pytest-xdist separately 2 年之前
setup.cfg 99713ae257 meta: add python 3.11 classifer 1 年之前
setup.py ad525dcce4 bump minimum required version of python to 3.7 2 年之前
sider.yml fa38aa378e add pylint config file. update Sider CI name 5 年之前
skip_ci.py 3c66be0c1d don't tell documentation contributors to skip CI 2 年之前

README.md

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

Status

PyPI Build Status Codecov

Dependencies

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

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:

python3 -m pip install meson

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

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:

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.