aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/backends.py7
-rw-r--r--mesonbuild/backend/vs2010backend.py8
-rw-r--r--mesonbuild/coredata.py5
-rw-r--r--mesonbuild/modules/pkgconfig.py5
4 files changed, 12 insertions, 13 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index a13c0ec..14f03b1 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -740,7 +740,7 @@ class Backend:
srcdir = self.environment.get_source_dir()
for dep in target.external_deps:
- if not isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)):
+ if dep.type_name not in {'library', 'pkgconfig'}:
continue
for libpath in dep.link_args:
# For all link args that are absolute paths to a library file, add RPATH args
@@ -1006,7 +1006,8 @@ class Backend:
continue
if compiler.language == 'vala':
- if isinstance(dep, dependencies.PkgConfigDependency):
+ if dep.type_name == 'pkgconfig':
+ assert isinstance(dep, dependencies.ExternalDependency)
if dep.name == 'glib-2.0' and dep.version_reqs is not None:
for req in dep.version_reqs:
if req.startswith(('>=', '==')):
@@ -1075,7 +1076,7 @@ class Backend:
results = set()
for dep in target.external_deps:
- if isinstance(dep, dependencies.PkgConfigDependency):
+ if dep.type_name == 'pkgconfig':
# If by chance pkg-config knows the bin dir...
bindir = dep.get_pkgconfig_variable('bindir', [], default='')
if bindir:
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index de6d8d7..d6b2f44 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -25,7 +25,6 @@ import re
from . import backends
from .. import build
-from .. import dependencies
from .. import mlog
from .. import compilers
from ..mesonlib import (
@@ -944,6 +943,7 @@ class Vs2010Backend(backends.Backend):
return self.gen_compile_target_vcxproj(target, ofname, guid)
else:
raise MesonException(f'Unknown target type for {target.get_basename()}')
+ assert isinstance(target, (build.Executable, build.SharedLibrary, build.StaticLibrary, build.SharedModule)), 'for mypy'
# Prefix to use to access the build root from the vcxproj dir
down = self.target_to_build_root(target)
# Prefix to use to access the source tree's root from the vcxproj dir
@@ -1175,7 +1175,7 @@ class Vs2010Backend(backends.Backend):
for d in reversed(target.get_external_deps()):
# Cflags required by external deps might have UNIX-specific flags,
# so filter them out if needed
- if isinstance(d, dependencies.OpenMPDependency):
+ if d.name == 'openmp':
ET.SubElement(clconf, 'OpenMPSupport').text = 'true'
else:
d_compile_args = compiler.unix_args_to_native(d.get_compile_args())
@@ -1288,14 +1288,14 @@ class Vs2010Backend(backends.Backend):
for dep in target.get_external_deps():
# Extend without reordering or de-dup to preserve `-L -l` sets
# https://github.com/mesonbuild/meson/issues/1718
- if isinstance(dep, dependencies.OpenMPDependency):
+ if dep.name == 'openmp':
ET.SubElement(clconf, 'OpenMPSupport').text = 'true'
else:
extra_link_args.extend_direct(dep.get_link_args())
for d in target.get_dependencies():
if isinstance(d, build.StaticLibrary):
for dep in d.get_external_deps():
- if isinstance(dep, dependencies.OpenMPDependency):
+ if dep.name == 'openmp':
ET.SubElement(clconf, 'OpenMPSupport').text = 'true'
else:
extra_link_args.extend_direct(dep.get_link_args())
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 46127c6..27b1b91 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -324,11 +324,10 @@ class DependencyCacheType(enum.Enum):
@classmethod
def from_type(cls, dep: 'dependencies.Dependency') -> 'DependencyCacheType':
- from . import dependencies
# As more types gain search overrides they'll need to be added here
- if isinstance(dep, dependencies.PkgConfigDependency):
+ if dep.type_name == 'pkgconfig':
return cls.PKG_CONFIG
- if isinstance(dep, dependencies.CMakeDependency):
+ if dep.type_name == 'cmake':
return cls.CMAKE
return cls.OTHER
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
index 714955d..921fb66 100644
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -26,7 +26,6 @@ from .. import dependencies
from .. import mesonlib
from .. import mlog
from ..coredata import BUILTIN_DIR_OPTIONS
-from ..dependencies import ThreadDependency
from ..dependencies.pkgconfig import PkgConfigDependency
from ..interpreter.type_checking import D_MODULE_VERSIONS_KW, INSTALL_DIR_KW, VARIABLES_KW, NoneType
from ..interpreterbase import FeatureNew, FeatureDeprecated
@@ -164,7 +163,7 @@ class DependenciesHelper:
self.add_version_reqs(name, [version_req] if version_req is not None else None)
elif isinstance(obj, dependencies.Dependency) and not obj.found():
pass
- elif isinstance(obj, ThreadDependency):
+ elif isinstance(obj, dependencies.ExternalDependency) and obj.name == 'threads':
pass
else:
raise mesonlib.MesonException('requires argument not a string, '
@@ -196,7 +195,7 @@ class DependenciesHelper:
and obj.get_id() in self.metadata):
self._check_generated_pc_deprecation(obj)
processed_reqs.append(self.metadata[obj.get_id()].filebase)
- elif isinstance(obj, dependencies.ValgrindDependency):
+ elif isinstance(obj, dependencies.ExternalDependency) and obj.name == 'valgrind':
pass
elif isinstance(obj, PkgConfigDependency):
if obj.found():