| 1 |
name: subproject |
| 2 |
returns: subproject |
| 3 |
description: | |
| 4 |
Takes the project specified in the positional argument and brings that |
| 5 |
in the current build specification by returning a [[@subproject]] object. |
| 6 |
Subprojects must always be placed inside |
| 7 |
the `subprojects` directory at the top source directory. So for |
| 8 |
example a subproject called `foo` must be located in |
| 9 |
`${MESON_SOURCE_ROOT}/subprojects/foo`. |
| 10 |
|
| 11 |
- `default_options` *(since 0.37.0)*: an array of default option values |
| 12 |
that override those set in the subproject's `meson.options` |
| 13 |
(like `default_options` in `project`, they only have effect when |
| 14 |
Meson is run for the first time, and command line arguments override |
| 15 |
any default options in build files). |
| 16 |
*(since 0.54.0)*: `default_library` built-in option can also be overridden. |
| 17 |
*(since 1.2.0)*: A dictionary may be passed instead of array. |
| 18 |
- `version`: works just like the same as in `dependency`. |
| 19 |
It specifies what version the subproject should be, as an example `>=1.0.1` |
| 20 |
- `required` *(since 0.48.0)*: By default, `required` is `true` and |
| 21 |
Meson will abort if the subproject could not be setup. You can set |
| 22 |
this to `false` and then use the `.found()` method on the [[@subproject]] |
| 23 |
object. You may also pass the value of a |
| 24 |
[`feature`](Build-options.md#features) option, same as |
| 25 |
[[dependency]]. |
| 26 |
|
| 27 |
Note that you can use the returned [[@subproject]] object |
| 28 |
to access any variable in the |
| 29 |
subproject. However, if you want to use a dependency object from |
| 30 |
inside a subproject, an easier way is to use the `fallback:` keyword |
| 31 |
argument to [[dependency]]. |
| 32 |
|
| 33 |
[See additional documentation](Subprojects.md). |
| 34 |
|
| 35 |
posargs: |
| 36 |
subproject_name: |
| 37 |
type: str |
| 38 |
description: | |
| 39 |
Name of the subproject. The subproject must exist in the `subprojects` |
| 40 |
directory (or the directory specified in the `subproject_dir` of |
| 41 |
[[project]]) as a directory or wrap file. |
| 42 |
|
| 43 |
kwargs: |
| 44 |
default_options: |
| 45 |
type: list[str] | dict[str | bool | int | list[str]] |
| 46 |
since: 0.37.0 |
| 47 |
description: | |
| 48 |
An array of default option values |
| 49 |
that override those set in the subproject's `meson.options` |
| 50 |
(like `default_options` in [[project]], they only have effect when |
| 51 |
Meson is run for the first time, and command line arguments override |
| 52 |
any default options in build files). |
| 53 |
*(since 0.54.0)*: `default_library` built-in option can also be overridden. |
| 54 |
*(since 1.2.0)*: A dictionary may now be passed. |
| 55 |
|
| 56 |
version: |
| 57 |
type: str | list[str] |
| 58 |
description: | |
| 59 |
Works just like the same as in [[dependency]]. |
| 60 |
It specifies what version the subproject should be, as an example `>=1.0.1`. |
| 61 |
|
| 62 |
required: |
| 63 |
type: bool | feature |
| 64 |
since: 0.48.0 |
| 65 |
default: true |
| 66 |
description: | |
| 67 |
Works just the same as in [[dependency]]. |