diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-02-22 09:38:25 -0500 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-02-28 09:03:27 -0500 |
commit | c4b8c23eb1dac4b5a556cbd9e7b16bae52bb9244 (patch) | |
tree | 9b9c158a664c8dff7aa8c2365b7fab4036da6141 /mesonbuild/modules | |
parent | ad75a2bfec7ca6cb13a3852afc618ee7c38d7baf (diff) | |
download | meson-c4b8c23eb1dac4b5a556cbd9e7b16bae52bb9244.zip meson-c4b8c23eb1dac4b5a556cbd9e7b16bae52bb9244.tar.gz meson-c4b8c23eb1dac4b5a556cbd9e7b16bae52bb9244.tar.bz2 |
Add API for modules that wants to define their devenv
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/__init__.py | 4 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index a3c6972..71536c1 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -26,6 +26,7 @@ if T.TYPE_CHECKING: from ..interpreterbase import TYPE_var, TYPE_kwargs from ..programs import ExternalProgram from ..wrap import WrapMode + from ..build import EnvironmentVariables class ModuleState: """Object passed to all module methods. @@ -148,6 +149,9 @@ class NewExtensionModule(ModuleObject): def found() -> bool: return True + def get_devenv(self) -> T.Optional['EnvironmentVariables']: + return None + # FIXME: Port all modules to stop using self.interpreter and use API on # ModuleState instead. Modules should stop using this class and instead use # ModuleObject base class. diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 06a1f34..ec11e31 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -752,9 +752,11 @@ class GnomeModule(ExtensionModule): def _devenv_prepend(self, varname: str, value: str) -> None: if self.devenv is None: self.devenv = build.EnvironmentVariables() - self.interpreter.build.devenv.append(self.devenv) self.devenv.prepend(varname, [value]) + def get_devenv(self) -> T.Optional[build.EnvironmentVariables]: + return self.devenv + def _get_gir_dep(self, state: 'ModuleState') -> T.Tuple[Dependency, T.Union[build.Executable, 'ExternalProgram', 'OverrideProgram'], T.Union[build.Executable, 'ExternalProgram', 'OverrideProgram']]: if not self.gir_dep: |