Debian Codegraph @

src/buildstream_plugins/elements/cmake.py

raw
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 # Authors:
15 # Tristan Van Berkom <[email protected]>
16
17 #
18 # This plugin was originally developped in the https://gitlab.com/BuildStream/bst-plugins-experimental/
19 # repository and was copied from a60426126e5bec2d630fcd889a9f5af13af00ea6
20 #
21
22 """
23 cmake - CMake build element
24 ===========================
25 This is a `BuildElement
26 <https://docs.buildstream.build/master/buildstream.buildelement.html#module-buildstream.buildelement>`_
27 implementation for using the `CMake <https://cmake.org/>`_ build system.
28
29 You will often want to pass additional arguments to the ``cmake`` program for
30 specific configuration options. This should be done on a per-element basis by
31 setting the ``cmake-local`` variable. Here is an example:
32
33 .. code:: yaml
34
35 variables:
36 cmake-local: |
37 -DCMAKE_BUILD_TYPE=Debug
38
39 If you want to pass extra options to ``cmake`` for every element in your
40 project, set the ``cmake-global`` variable in your project.conf file. Here is
41 an example of that:
42
43 .. code:: yaml
44
45 elements:
46 cmake:
47 variables:
48 cmake-global: |
49 -DCMAKE_BUILD_TYPE=Release
50
51 Here is the default configuration for the ``cmake`` element in full:
52
53 .. literalinclude:: ../../../src/buildstream_plugins/elements/cmake.yaml
54 :language: yaml
55
56 See `built-in functionality documentation
57 <https://docs.buildstream.build/master/buildstream.buildelement.html#core-buildelement-builtins>`_ for
58 details on common configuration options for build elements.
59 """
60
61 from buildstream import BuildElement
62
63
64 # Element implementation for the 'cmake' kind.
65 class CMakeElement(BuildElement):
66
67 BST_MIN_VERSION = "2.0"
68
69
70 # Plugin entry point
71 def setup():
72 return CMakeElement