aboutsummaryrefslogtreecommitdiff
path: root/docs/yaml/functions/build_target.yaml
blob: f883e87f14a124c4d6318054718acedd398007d7 (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
46
47
48
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 arrays for the kwargs (such as `sources`, `objects`, and `dependencies`) are
  always flattened, which means you can freely nest and add arrays while
  creating the final array.

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

  *"jar" is deprecated because it is fundamentally a different thing than the
  other build_target types.

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

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