modules: modules need to return either an ExtensionModlue or a

NewExtensionModule object

So that we get the found() method.
pull/8950/head
Dylan Baker 4 years ago
parent 1416ba0b8d
commit 4a0a6a8083
  1. 4
      mesonbuild/interpreter/interpreter.py
  2. 4
      mesonbuild/modules/unstable_cuda.py
  3. 4
      mesonbuild/modules/unstable_external_project.py

@ -32,7 +32,7 @@ from ..interpreterbase import Disabler, disablerIfNotFound
from ..interpreterbase import FeatureNew, FeatureDeprecated, FeatureNewKwargs, FeatureDeprecatedKwargs
from ..interpreterbase import ObjectHolder, RangeHolder
from ..interpreterbase import TYPE_nkwargs, TYPE_nvar, TYPE_var
from ..modules import ModuleObject, MutableModuleObject
from ..modules import ExtensionModule, ModuleObject, MutableModuleObject, NewExtensionModule
from ..cmake import CMakeInterpreter
from ..backend.backends import Backend, ExecutableSerialisation
@ -304,7 +304,7 @@ class Interpreter(InterpreterBase, HoldableObject):
subproject: str = '',
subdir: str = '',
subproject_dir: str = 'subprojects',
modules: T.Optional[T.Dict[str, ModuleObject]] = None,
modules: T.Optional[T.Dict[str, T.Union[ExtensionModule, NewExtensionModule]]] = None,
default_project_options: T.Optional[T.Dict[str, str]] = None,
mock: bool = False,
ast: T.Optional[mparser.CodeBlockNode] = None,

@ -18,14 +18,14 @@ import re
from ..mesonlib import version_compare
from ..compilers import CudaCompiler, Compiler
from . import ModuleObject
from . import NewExtensionModule
from ..interpreterbase import (
flatten, permittedKwargs, noKwargs,
InvalidArguments, FeatureNew
)
class CudaModule(ModuleObject):
class CudaModule(NewExtensionModule):
@FeatureNew('CUDA module', '0.50.0')
def __init__(self, *args, **kwargs):

@ -16,7 +16,7 @@ import os, subprocess, shlex
from pathlib import Path
import typing as T
from . import ExtensionModule, ModuleReturnValue, ModuleState, ModuleObject
from . import ExtensionModule, ModuleReturnValue, ModuleState, NewExtensionModule
from .. import mlog, build
from ..mesonlib import (MesonException, Popen_safe, MachineChoice,
get_variable_regex, do_replacement, extract_as_list)
@ -26,7 +26,7 @@ from ..compilers.compilers import CFLAGS_MAPPING, CEXE_MAPPING
from ..dependencies import InternalDependency, PkgConfigDependency
from ..mesonlib import OptionKey
class ExternalProject(ModuleObject):
class ExternalProject(NewExtensionModule):
def __init__(self,
state: ModuleState,
configure_command: str,

Loading…
Cancel
Save