diff options
-rw-r--r-- | mesonbuild/dependencies/base.py | 17 | ||||
-rw-r--r-- | mesonbuild/dependencies/boost.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/coarrays.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/cuda.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/dev.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/factory.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/misc.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/mpi.py | 3 | ||||
-rw-r--r-- | mesonbuild/dependencies/system.py | 29 | ||||
-rw-r--r-- | mesonbuild/dependencies/ui.py | 3 | ||||
-rw-r--r-- | mesonbuild/modules/python.py | 2 |
11 files changed, 26 insertions, 44 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index da8fc54..66fbc85 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -534,3 +534,20 @@ def detect_compiler(name: str, env: 'Environment', for_machine: MachineChoice, except KeyError: continue return None + + +class SystemDependency(ExternalDependency): + + """Dependency base for System type dependencies.""" + + def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], + language: T.Optional[str] = None) -> None: + super().__init__(DependencyTypeName('system'), env, kwargs, language=language) + self.name = name + + @staticmethod + def get_methods() -> T.List[DependencyMethods]: + return [DependencyMethods.SYSTEM] + + def log_tried(self) -> str: + return 'system' diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py index fabebfa..dc317cd 100644 --- a/mesonbuild/dependencies/boost.py +++ b/mesonbuild/dependencies/boost.py @@ -21,10 +21,9 @@ from .. import mlog from .. import mesonlib from ..environment import Environment -from .base import DependencyException +from .base import DependencyException, SystemDependency from .pkgconfig import PkgConfigDependency from .misc import threads_factory -from .system import SystemDependency if T.TYPE_CHECKING: from ..environment import Properties diff --git a/mesonbuild/dependencies/coarrays.py b/mesonbuild/dependencies/coarrays.py index f2aa608..d9af191 100644 --- a/mesonbuild/dependencies/coarrays.py +++ b/mesonbuild/dependencies/coarrays.py @@ -15,11 +15,10 @@ import functools import typing as T -from .base import DependencyMethods, detect_compiler +from .base import DependencyMethods, detect_compiler, SystemDependency from .cmake import CMakeDependency from .pkgconfig import PkgConfigDependency from .factory import factory_methods -from .system import SystemDependency if T.TYPE_CHECKING: from . factory import DependencyGenerator diff --git a/mesonbuild/dependencies/cuda.py b/mesonbuild/dependencies/cuda.py index d396dbe..43bb622 100644 --- a/mesonbuild/dependencies/cuda.py +++ b/mesonbuild/dependencies/cuda.py @@ -21,8 +21,7 @@ from pathlib import Path from .. import mesonlib from .. import mlog from ..environment import detect_cpu_family -from .base import DependencyException -from .system import SystemDependency +from .base import DependencyException, SystemDependency if T.TYPE_CHECKING: diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index ab9e9e5..60c4b74 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -26,13 +26,12 @@ from .. import mesonlib, mlog from ..compilers import AppleClangCCompiler, AppleClangCPPCompiler from ..environment import get_llvm_tool_names from ..mesonlib import version_compare, stringlistify, extract_as_list, MachineChoice -from .base import DependencyException, DependencyMethods, strip_system_libdirs +from .base import DependencyException, DependencyMethods, strip_system_libdirs, SystemDependency from .cmake import CMakeDependency from .configtool import ConfigToolDependency from .factory import DependencyFactory from .misc import threads_factory from .pkgconfig import PkgConfigDependency -from .system import SystemDependency if T.TYPE_CHECKING: from ..envconfig import MachineInfo diff --git a/mesonbuild/dependencies/factory.py b/mesonbuild/dependencies/factory.py index 9ee5bfd..774e88e 100644 --- a/mesonbuild/dependencies/factory.py +++ b/mesonbuild/dependencies/factory.py @@ -20,10 +20,10 @@ from ..mesonlib import MachineChoice from .base import DependencyException, DependencyMethods from .base import ExternalDependency from .base import process_method_kw +from .base import SystemDependency from .cmake import CMakeDependency from .framework import ExtraFrameworkDependency from .pkgconfig import PkgConfigDependency -from .system import SystemDependency if T.TYPE_CHECKING: from ..environment import Environment diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index eb712b1..87b1a9b 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -24,11 +24,11 @@ from .. import mesonlib from .. import mlog from ..environment import detect_cpu_family from .base import DependencyException, DependencyMethods +from .base import SystemDependency from .cmake import CMakeDependency from .configtool import ConfigToolDependency from .factory import DependencyFactory, factory_methods from .pkgconfig import PkgConfigDependency -from .system import SystemDependency if T.TYPE_CHECKING: from ..environment import Environment, MachineChoice diff --git a/mesonbuild/dependencies/mpi.py b/mesonbuild/dependencies/mpi.py index 8985b79..2354767 100644 --- a/mesonbuild/dependencies/mpi.py +++ b/mesonbuild/dependencies/mpi.py @@ -18,11 +18,10 @@ import os import re from ..environment import detect_cpu_family -from .base import DependencyMethods, detect_compiler +from .base import DependencyMethods, detect_compiler, SystemDependency from .configtool import ConfigToolDependency from .factory import factory_methods from .pkgconfig import PkgConfigDependency -from .system import SystemDependency if T.TYPE_CHECKING: from .factory import DependencyGenerator diff --git a/mesonbuild/dependencies/system.py b/mesonbuild/dependencies/system.py deleted file mode 100644 index afde872..0000000 --- a/mesonbuild/dependencies/system.py +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright © 2021 Intel Corporation - -from .base import DependencyTypeName, ExternalDependency, DependencyMethods -import typing as T - -if T.TYPE_CHECKING: - from ..environment import Environment - -__all__ = [ - 'SystemDependency', -] - - -class SystemDependency(ExternalDependency): - - """Dependency base for System type dependencies.""" - - def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], - language: T.Optional[str] = None) -> None: - super().__init__(DependencyTypeName('system'), env, kwargs, language=language) - self.name = name - - @staticmethod - def get_methods() -> T.List[DependencyMethods]: - return [DependencyMethods.SYSTEM] - - def log_tried(self) -> str: - return 'system' diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 1646ddf..f256a37 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -25,10 +25,9 @@ from ..mesonlib import ( ) from ..environment import detect_cpu_family -from .base import DependencyException, DependencyMethods, DependencyTypeName +from .base import DependencyException, DependencyMethods, DependencyTypeName, SystemDependency from .configtool import ConfigToolDependency from .factory import DependencyFactory -from .system import SystemDependency if T.TYPE_CHECKING: from ..environment import Environment diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 94e100b..f109503 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -31,7 +31,7 @@ from ..build import known_shmod_kwargs from .. import mlog from ..environment import detect_cpu_family from ..dependencies import DependencyMethods, PkgConfigDependency, NotFoundDependency -from ..dependencies.system import SystemDependency +from ..dependencies.base import SystemDependency from ..programs import ExternalProgram, NonExistingExternalProgram mod_kwargs = {'subdir'} |