mmeson.meson_interface module
Module containing Meson-related classes and funtions.
- class mmeson.meson_interface.ExitAction(value)
Bases:
EnumEnum for the exit action. TODO more explaination.
- NOTHING = 'nothing'
Exit without saving the changed config values.
- ONLY_CONFIGURE = 'only-configure'
Exit without saving the changed config values.
- RECONFIGURE = 'reconfigure'
Same as
ONLY_CONFIGUREbut callsmeson setup --reconfigureafterwards.
- class mmeson.meson_interface.MesonManager(*args, **kwargs)
Bases:
objectSingleton class managing Meson-related parsing and actions.
- builddir
pathlib.Pathcontaining the builddir (has to be set viaset_builddir()).
- meson_bin
strpointing to the Meson binary (has to be set viaset_meson_bin()).
- exit_action
see
ExitActionfor details.
- set_builddir(builddir: Path)
Sets the builddir of the Meson project.
- Parameters
builddir¶ –
pathlib.Pathpointing to the builddir.
- get_intro_file(intro_file: str) dict
Loads and introspection file from the
meson-infofolder and parses the json into adict.- Parameters
intro_file¶ – Name of the introspection file.
- Returns
The dict contained in the introspection file.
- parse_buildoptions() list[mmeson.options.Option]
Parses the build options given by Meson in the builddir.
- Returns
List of
Optionparsed from the builddir.
- parse_projectinfo() tuple[str, str]
Parses the project info given by Meson in the builddir.
- Returns
Tuple of strings containing the project name and project version.
- parse_meson_version() str
Parses the meson version given by Meson in the builddir.
- Returns
String containing the used meson version.
- parse_meson_workdir() Path
Parses the meson source folder given by Meson in the builddir.
- Returns
pathlib.Pathcontaining path to the source folder.
- set_exit_action(exit_action: ExitAction) None
Sets the action to be done when
run_exit_action()is called.- Parameters
exit_action¶ – see
ExitActionfor details.
- run_exit_action() int
Runs the exit action. For exact behaviour see
ExitActionfor details.- Returns
Return code from the last Meson call or
0if Meson is never called.