aboutsummaryrefslogtreecommitdiff
path: root/docs/yaml/functions/build_target.yaml
blob: 48385f2525809b337ee245ab0a3c6e12886b23cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: build_target
returns: build_tgt
description: |
  Creates a build target whose type can be set dynamically with the
  `target_type` keyword argument.

  `target_type` may be set to one of:

  - `executable` (see [[executable]])
  - `shared_library` (see [[shared_library]])
  - `shared_module` (see [[shared_module]])
  - `static_library` (see [[static_library]])
  - `both_libraries` (see [[both_libraries]])
  - `library` (see [[library]])
  - `jar` (see [[jar]])

  This declaration:

  ```meson
  executable(<arguments and keyword arguments>)
  ```

  is equivalent to this:

  ```meson
  build_target(<arguments and keyword arguments>, target_type : 'executable')
  ```

  The lists for the kwargs (such as `sources`, `objects`, and `dependencies`) are
  always flattened, which means you can freely nest and add lists while
  creating the final list.

  The returned object also has methods that are documented in [[@build_tgt]].

posargs_inherit: _build_target_base
varargs_inherit: _build_target_base
kwargs_inherit:
  - executable
  - library
  - jar

kwargs:
  target_type:
    type: str
    description: The actual target to build