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.