| 1 |
name: import |
| 2 |
returns: module |
| 3 |
description: | |
| 4 |
Imports the given extension module. Returns an object that can be used to call |
| 5 |
the methods of the module. Here's an example for a hypothetical `testmod` |
| 6 |
module. |
| 7 |
|
| 8 |
example: | |
| 9 |
```meson |
| 10 |
tmod = import('testmod') |
| 11 |
tmod.do_something() |
| 12 |
``` |
| 13 |
|
| 14 |
posargs: |
| 15 |
module_name: |
| 16 |
type: str |
| 17 |
description: Name of the module to import. |
| 18 |
|
| 19 |
kwargs: |
| 20 |
required: |
| 21 |
type: bool | feature |
| 22 |
default: true |
| 23 |
since: 0.59.0 |
| 24 |
description: |
| 25 |
When set to `false`, Meson will proceed with the build even if the module |
| 26 |
is not found. |
| 27 |
|
| 28 |
When set to a [`feature`](Build-options.md#features) option, the feature |
| 29 |
will control if it is searched and whether to fail if not found. |
| 30 |
|
| 31 |
disabler: |
| 32 |
type: bool |
| 33 |
since: 0.59.0 |
| 34 |
description: Returns a [[@disabler]] object when not found. |