| 1 |
name: build_target |
| 2 |
returns: build_tgt |
| 3 |
description: | |
| 4 |
Creates a build target whose type can be set dynamically with the |
| 5 |
`target_type` keyword argument. |
| 6 |
|
| 7 |
`target_type` may be set to one of: |
| 8 |
|
| 9 |
- `executable` (see [[executable]]) |
| 10 |
- `shared_library` (see [[shared_library]]) |
| 11 |
- `shared_module` (see [[shared_module]]) |
| 12 |
- `static_library` (see [[static_library]]) |
| 13 |
- `both_libraries` (see [[both_libraries]]) |
| 14 |
- `library` (see [[library]]) |
| 15 |
- `jar` (see [[jar]])* |
| 16 |
|
| 17 |
This declaration: |
| 18 |
|
| 19 |
```meson |
| 20 |
executable(<arguments and keyword arguments>) |
| 21 |
``` |
| 22 |
|
| 23 |
is equivalent to this: |
| 24 |
|
| 25 |
```meson |
| 26 |
build_target(<arguments and keyword arguments>, target_type : 'executable') |
| 27 |
``` |
| 28 |
|
| 29 |
The lists for the kwargs (such as `sources`, `objects`, and `dependencies`) are |
| 30 |
always flattened, which means you can freely nest and add lists while |
| 31 |
creating the final list. |
| 32 |
|
| 33 |
The returned object also has methods that are documented in [[@build_tgt]]. |
| 34 |
|
| 35 |
*"jar" is deprecated because it is fundamentally a different thing than the |
| 36 |
other build_target types. |
| 37 |
|
| 38 |
posargs_inherit: _build_target_base |
| 39 |
varargs_inherit: _build_target_base |
| 40 |
kwargs_inherit: |
| 41 |
- executable |
| 42 |
- library |
| 43 |
- jar |
| 44 |
|
| 45 |
kwargs: |
| 46 |
target_type: |
| 47 |
type: str |
| 48 |
description: The actual target type to build |