2017-05-03 17:38:41 +08:00
|
|
|
---
|
|
|
|
short-description: Meson modules for common build operations
|
|
|
|
...
|
|
|
|
|
2017-03-30 02:03:43 +08:00
|
|
|
# Modules
|
|
|
|
|
2021-01-30 19:20:59 +08:00
|
|
|
In addition to core language features, Meson also provides a module
|
|
|
|
system aimed at providing helper methods for common build operations.
|
|
|
|
Using modules is simple, first you import them:
|
2017-03-30 02:03:43 +08:00
|
|
|
|
|
|
|
```meson
|
|
|
|
mymod = import('somemodule')
|
|
|
|
```
|
|
|
|
|
2021-01-30 19:20:59 +08:00
|
|
|
After this you can use the returned object to use the functionality
|
|
|
|
provided:
|
2017-03-30 02:03:43 +08:00
|
|
|
|
|
|
|
```meson
|
|
|
|
mymod.do_something('text argument')
|
|
|
|
```
|
|
|
|
|
|
|
|
Meson has a selection of modules to make common requirements easy to
|
|
|
|
use. Modules can be thought of like the standard library of a
|
|
|
|
programming language. Currently Meson provides the modules listed on
|
|
|
|
subpages.
|