| 1 |
# |
| 2 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 |
# you may not use this file except in compliance with the License. |
| 4 |
# You may obtain a copy of the License at |
| 5 |
# |
| 6 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 |
# |
| 8 |
# Unless required by applicable law or agreed to in writing, software |
| 9 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 |
# See the License for the specific language governing permissions and |
| 12 |
# limitations under the License. |
| 13 |
|
| 14 |
# |
| 15 |
# This plugin was originally developped in the https://gitlab.com/BuildStream/bst-plugins-experimental/ |
| 16 |
# repository and was copied from a60426126e5bec2d630fcd889a9f5af13af00ea6 |
| 17 |
# |
| 18 |
|
| 19 |
""" |
| 20 |
meson - Meson build element |
| 21 |
=========================== |
| 22 |
This is a `BuildElement |
| 23 |
<https://docs.buildstream.build/master/buildstream.buildelement.html#module-buildstream.buildelement>`_ |
| 24 |
implementation for using `Meson <http://mesonbuild.com/>`_ build scripts. |
| 25 |
|
| 26 |
You will often want to pass additional arguments to ``meson``. This should |
| 27 |
be done on a per-element basis by setting the ``meson-local`` variable. Here is |
| 28 |
an example: |
| 29 |
|
| 30 |
.. code:: yaml |
| 31 |
|
| 32 |
variables: |
| 33 |
meson-local: | |
| 34 |
-Dmonkeys=yes |
| 35 |
|
| 36 |
If you want to pass extra options to ``meson`` for every element in your |
| 37 |
project, set the ``meson-global`` variable in your project.conf file. Here is |
| 38 |
an example of that: |
| 39 |
|
| 40 |
.. code:: yaml |
| 41 |
|
| 42 |
elements: |
| 43 |
meson: |
| 44 |
variables: |
| 45 |
meson-global: | |
| 46 |
-Dmonkeys=always |
| 47 |
|
| 48 |
Here is the default configuration for the ``meson`` element in full: |
| 49 |
|
| 50 |
.. literalinclude:: ../../../src/buildstream_plugins/elements/meson.yaml |
| 51 |
:language: yaml |
| 52 |
|
| 53 |
See `built-in functionality documentation |
| 54 |
<https://docs.buildstream.build/master/buildstream.buildelement.html#core-buildelement-builtins>`_ for |
| 55 |
details on common configuration options for build elements. |
| 56 |
""" |
| 57 |
|
| 58 |
from buildstream import BuildElement |
| 59 |
|
| 60 |
|
| 61 |
# Element implementation for the 'meson' kind. |
| 62 |
class MesonElement(BuildElement): |
| 63 |
|
| 64 |
BST_MIN_VERSION = "2.0" |
| 65 |
|
| 66 |
|
| 67 |
# Plugin entry point |
| 68 |
def setup(): |
| 69 |
return MesonElement |