| 1 |
<p align="center"> |
| 2 |
<img src="https://mesonbuild.com/assets/images/meson_logo.png"> |
| 3 |
</p> |
| 4 |
MesonĀ® is a project to create the best possible next-generation |
| 5 |
build system. |
| 6 |
|
| 7 |
#### Status |
| 8 |
|
| 9 |
[](https://pypi.python.org/pypi/meson) |
| 10 |
[](https://dev.azure.com/jussi0947/jussi/_build/latest?definitionId=1) |
| 11 |
[](https://codecov.io/gh/mesonbuild/meson/branch/master) |
| 12 |
|
| 13 |
#### Dependencies |
| 14 |
|
| 15 |
- [Python](https://python.org) (version 3.10 or newer) |
| 16 |
- [Ninja](https://ninja-build.org) (version 1.8.2 or newer) |
| 17 |
|
| 18 |
Latest Meson version supporting previous Python versions: |
| 19 |
- Python 3.9: **1.11** |
| 20 |
- Python 3.8: **1.11** |
| 21 |
- Python 3.7: **1.11** |
| 22 |
- Python 3.6: **0.61.5** |
| 23 |
- Python 3.5: **0.56.2** |
| 24 |
- Python 3.4: **0.45.1** |
| 25 |
|
| 26 |
#### Installing from source |
| 27 |
|
| 28 |
Meson is available on [PyPI](https://pypi.python.org/pypi/meson), so |
| 29 |
it can be installed with `pip3 install meson`. The exact command to |
| 30 |
type to install with `pip` can vary between systems, be sure to use |
| 31 |
the Python 3 version of `pip`. |
| 32 |
|
| 33 |
If you wish you can install it locally with the standard Python command: |
| 34 |
|
| 35 |
```console |
| 36 |
python3 -m pip install meson |
| 37 |
``` |
| 38 |
|
| 39 |
For builds using Ninja, Ninja can be downloaded directly from Ninja |
| 40 |
[GitHub release page](https://github.com/ninja-build/ninja/releases) |
| 41 |
or via [PyPI](https://pypi.python.org/pypi/ninja) |
| 42 |
|
| 43 |
```console |
| 44 |
python3 -m pip install ninja |
| 45 |
``` |
| 46 |
|
| 47 |
More on Installing Meson build can be found at the |
| 48 |
[getting meson page](https://mesonbuild.com/Getting-meson.html). |
| 49 |
|
| 50 |
#### Creating a standalone script |
| 51 |
|
| 52 |
Meson can be run as a [Python zip |
| 53 |
app](https://docs.python.org/3/library/zipapp.html). To generate the |
| 54 |
executable run the following command: |
| 55 |
|
| 56 |
./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' <source checkout> |
| 57 |
|
| 58 |
#### Running |
| 59 |
|
| 60 |
Meson requires that you have a source directory and a build directory |
| 61 |
and that these two are different. In your source root must exist a |
| 62 |
file called `meson.build`. To generate the build system run this |
| 63 |
command: |
| 64 |
|
| 65 |
`meson setup <source directory> <build directory>` |
| 66 |
|
| 67 |
Depending on how you obtained Meson the command might also be called |
| 68 |
`meson.py` instead of plain `meson`. In the rest of this document we |
| 69 |
are going to use the latter form. |
| 70 |
|
| 71 |
You can omit either of the two directories, and Meson will substitute |
| 72 |
the current directory and autodetect what you mean. This allows you to |
| 73 |
do things like this: |
| 74 |
|
| 75 |
```console |
| 76 |
cd <source root> |
| 77 |
meson setup builddir |
| 78 |
``` |
| 79 |
|
| 80 |
To compile, cd into your build directory and type `ninja`. To run unit |
| 81 |
tests, type `ninja test`. |
| 82 |
|
| 83 |
More on running Meson build system commands can be found at the |
| 84 |
[running meson page](https://mesonbuild.com/Running-Meson.html) |
| 85 |
or by typing `meson --help`. |
| 86 |
|
| 87 |
#### Contributing |
| 88 |
|
| 89 |
We love code contributions. See the [contribution |
| 90 |
page](https://mesonbuild.com/Contributing.html) on the website for |
| 91 |
details. |
| 92 |
|
| 93 |
|
| 94 |
#### IRC |
| 95 |
|
| 96 |
The channel to use is `#mesonbuild` either via Matrix ([web |
| 97 |
interface][matrix_web]) or [OFTC IRC][oftc_irc]. |
| 98 |
|
| 99 |
[matrix_web]: https://app.element.io/#/room/#mesonbuild:matrix.org |
| 100 |
[oftc_irc]: https://www.oftc.net/ |
| 101 |
|
| 102 |
#### Further info |
| 103 |
|
| 104 |
More information about the Meson build system can be found at the |
| 105 |
[project's home page](https://mesonbuild.com). |
| 106 |
|
| 107 |
Meson is a registered trademark of ***Jussi Pakkanen***. |