Add additional info to MesonPackage docs (#10133)

* Add additional info to MesonPackage docs

* No Pygments lexer for Meson code, default to none
This commit is contained in:
Adam J. Stewart 2018-12-18 21:51:42 -06:00 committed by GitHub
parent b091fcdb8e
commit c1a99bf8ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,28 @@ Packages that use the Meson build system can be identified by the
presence of a ``meson.build`` file. This file declares things
like build instructions and dependencies.
One thing to look for is the ``meson_version`` key that gets passed
to the ``project`` function:
.. code-block:: none
:emphasize-lines: 10
project('gtk+', 'c',
version: '3.94.0',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
# We only need c99, but glib needs GNU-specific features
# https://github.com/mesonbuild/meson/issues/2289
'c_std=gnu99',
],
meson_version: '>= 0.43.0',
license: 'LGPLv2.1+')
This means that Meson 0.43.0 is the earliest release that will work.
You should specify this in a ``depends_on`` statement.
^^^^^^^^^^^^^^^^^^^^^^^^^
Build system dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^
@ -67,6 +89,28 @@ the ``MesonPackage`` base class already contains:
depends_on('meson', type='build')
depends_on('ninja', type='build')
If you need to specify a particular version requirement, you can
override this in your package:
.. code-block:: python
depends_on('meson@0.43.0:', type='build')
depends_on('ninja', type='build')
^^^^^^^^^^^^^^^^^^^
Finding meson flags
^^^^^^^^^^^^^^^^^^^
To get a list of valid flags that can be passed to ``meson``, run the
following command in the directory that contains ``meson.build``:
.. code-block:: console
$ meson setup --help
^^^^^^^^^^^^^^^^^^^^^^^^^^
Passing arguments to meson
^^^^^^^^^^^^^^^^^^^^^^^^^^