aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 84b20e7..682182c 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -132,6 +132,9 @@ class Dependency:
def get_pkgconfig_variable(self, variable_name):
raise NotImplementedError('{!r} is not a pkgconfig dependency'.format(self.name))
+ def get_configtool_variable(self, variable_name):
+ raise NotImplementedError('{!r} is not a config-tool dependency'.format(self.name))
+
class InternalDependency(Dependency):
def __init__(self, version, incdirs, compile_args, link_args, libraries, sources, ext_deps):
@@ -288,6 +291,17 @@ class ConfigToolDependency(ExternalDependency):
def get_methods(self):
return [DependencyMethods.AUTO, DependencyMethods.CONFIG_TOOL]
+ def get_configtool_variable(self, variable_name):
+ p, out, _ = Popen_safe([self.config, '--{}'.format(variable_name)])
+ if p.returncode != 0:
+ if self.required:
+ raise DependencyException(
+ 'Could not get variable "{}" for dependency {}'.format(
+ variable_name, self.name))
+ variable = out.strip()
+ mlog.debug('Got config-tool variable {} : {}'.format(variable_name, variable))
+ return variable
+
class PkgConfigDependency(ExternalDependency):
# The class's copy of the pkg-config path. Avoids having to search for it