2025-03-14 21:59:59 -06:00
|
|
|
# meson
|
|
|
|
|
|
|
|
|
|
> SCons-like build system that uses Python as a front-end language and Ninja as a building backend.
|
2025-05-08 12:26:01 -06:00
|
|
|
> More information: <https://mesonbuild.com/Commands.html>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
- Generate a project with default values:
|
|
|
|
|
|
|
|
|
|
`meson init`
|
|
|
|
|
|
2025-03-14 21:59:59 -06:00
|
|
|
- Generate a C project with a given name and version:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`meson init {{[-l|--language]}} c {{[-n|--name]}} {{myproject}} --version {{0.1}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
- Configure a directory named `build` with default values for compilation:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`meson {{[build|setup build]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
- Compile the project:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`meson compile -C {{path/to/build_directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Run all tests in the project:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`meson test -C {{path/to/build_directory}}`
|
|
|
|
|
|
|
|
|
|
- Install the project to `/usr/local`:
|
|
|
|
|
|
|
|
|
|
`meson install -C {{path/to/build_directory}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
- Display help:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`meson {{[-h|--help]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Display version:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`meson {{[-v|--version]}}`
|