sudo dnf install meson # Fedora
-Some older versions of meson do not check that they are too old and will
+Some older versions of Meson do not check that they are too old and will
error out in odd ways.
You'll also need `Ninja <https://ninja-build.org/>`__. If it's not
Windows
^^^^^^^
-You will need to install python3 and meson as a module using pip. This
+You will need to install python3 and Meson as a module using pip. This
is because we use python for generating code, and rely on external
-modules (mako). You also need pkg-config (a hard dependency of meson),
+modules (mako). You also need pkg-config (a hard dependency of Meson),
flex, and bison. The easiest way to install everything you need is with
`chocolatey <https://chocolatey.org/>`__.
choco install ninja mingw
-Then install meson using pip
+Then install Meson using pip
.. code-block:: console
py -3 -m pip install meson mako
You may need to add the python3 scripts directory to your path for
-meson.
+Meson.
2. Basic Usage
--------------
-The meson program is used to configure the source directory and
+The Meson program is used to configure the source directory and
generates either a ninja build file or Visual Studio® build files. The
latter must be enabled via the ``--backend`` switch, as ninja is the
default backend on all operating systems.
clang-cl, or ICL (the Intel Compiler), read on.
Both ICL and MSVC come with shell environments, the easiest way to use
-meson with these it to open a shell. For clang-cl you will need to open
+Meson with these it to open a shell. For clang-cl you will need to open
an MSVC shell, and then override the compilers, either using a `native
file <https://mesonbuild.com/Native-environments.html>`__, or with the
CC and CXX environment variables.
All of these compilers are tested and work with ninja, but if you want
visual studio integration or you just like msbuild, passing
-``--backend=vs`` to meson will generate a visual studio solution. If you
-want to use ICL or clang-cl with the vsbackend you will need meson
+``--backend=vs`` to Meson will generate a visual studio solution. If you
+want to use ICL or clang-cl with the vsbackend you will need Meson
0.52.0 or greater. Older versions always use the microsoft compiler.
3. Advanced Usage
Meson includes upstream logic to wrap llvm-config using its standard
dependency interface.
-As of meson 0.51.0 meson can use cmake to find LLVM (the cmake finder
-was added in meson 0.49.0, but LLVM cannot be found until 0.51) Due to
+As of Meson 0.51.0 Meson can use cmake to find LLVM (the cmake finder
+was added in Meson 0.49.0, but LLVM cannot be found until 0.51) Due to
the way LLVM implements its cmake finder it will only find static
libraries, it will never find libllvm.so. There is also a
-``-Dcmake_module_path`` option in this meson version, which points to
+``-Dcmake_module_path`` option in this Meson version, which points to
the root of an alternative installation (the prefix). For example:
.. code-block:: console
meson builddir -Dcmake_module_path=/home/user/mycmake/prefix
-As of meson 0.49.0 meson also has the concept of a `"native
+As of Meson 0.49.0 Meson also has the concept of a `"native
file" <https://mesonbuild.com/Native-environments.html>`__, these files
provide information about the native build environment (as opposed to a
cross build environment). They are ini formatted and can override where
[binaries]
llvm-config = '/usr/local/bin/llvm/llvm-config'
-Then configure meson:
+Then configure Meson:
.. code-block:: console
Obviously, only cmake or llvm-config is required.
-Then configure meson:
+Then configure Meson:
.. code-block:: console
Options
^^^^^^^
-One of the oddities of meson is that some options are different when
+One of the oddities of Meson is that some options are different when
passed to the ``meson`` than to ``meson configure``. These options are
passed as --option=foo to ``meson``, but -Doption=foo to
``meson configure``. Mesa defined options are always passed as
This option will set the compiler debug/optimisation levels to aid
debugging the Mesa libraries.
- Note that in meson this defaults to ``debugoptimized``, and not
+ Note that in Meson this defaults to ``debugoptimized``, and not
setting it to ``release`` will yield non-optimal performance and
binary size. Not using ``debug`` may interfere with debugging as some
code and validation will be optimized away.
For those wishing to pass their own optimization flags, use the
- ``plain`` buildtype, which causes meson to inject no additional
+ ``plain`` buildtype, which causes Meson to inject no additional
compiler arguments, only those in the C/CXXFLAGS and those that mesa
itself defines.
``-Db_ndebug``
- This option controls assertions in meson projects. When set to
+ This option controls assertions in Meson projects. When set to
``false`` (the default) assertions are enabled, when set to true they
are disabled. This is unrelated to the ``buildtype``; setting the
latter to ``release`` will not turn off assertions.