meson: added variants, changed defaults for the build system (#22715)

- Use debugoptimized as default build type, just like RelWithDebInfo for cmake
- Do not strip by default, and add a default_library variant which conveniently support both shared and static
This commit is contained in:
Harmen Stoppels
2021-04-06 17:57:31 +02:00
committed by GitHub
parent a4c3bc9893
commit bbc666a1d2
2 changed files with 21 additions and 4 deletions

View File

@@ -121,11 +121,15 @@ override the ``meson_args`` method like so:
.. code-block:: python
def meson_args(self):
return ['--default-library=both']
return ['--warnlevel=3']
This method can be used to pass flags as well as variables.
Note that the ``MesonPackage`` base class already defines variants for
``buildtype``, ``default_library`` and ``strip``, which are mapped to default
Meson arguments, meaning that you don't have to specify these.
^^^^^^^^^^^^^^^^^^^^^^
External documentation
^^^^^^^^^^^^^^^^^^^^^^