dependencies: Rename _add_sub_dependency2 to _add_sub_dependency

Since the original _add_sub_dependency is no longer in use.
pull/6540/head
Dylan Baker 5 years ago
parent 6440b55b07
commit 5ab29e264b
  1. 16
      mesonbuild/dependencies/base.py
  2. 2
      mesonbuild/dependencies/boost.py
  3. 10
      mesonbuild/dependencies/dev.py

@ -180,7 +180,7 @@ class Dependency:
"""
raise RuntimeError('Unreachable code in partial_dependency called')
def _add_sub_dependency2(self, deplist: T.List['DependencyType']) -> bool:
def _add_sub_dependency(self, deplist: T.List['DependencyType']) -> bool:
"""Add an internal depdency from a list of possible dependencies.
This method is intended to make it easier to add additional
@ -196,20 +196,6 @@ class Dependency:
return True
return False
def _add_sub_dependency(self, dep_type: T.Type['Dependency'], name: str,
env: Environment, kwargs: T.Dict[str, T.Any], *,
method: DependencyMethods = DependencyMethods.AUTO) -> None:
"""Add an internal dependency of of the given type.
This method is intended to simplify cases of adding a dependency on
another dependency type (such as threads). This will by default set
the method back to auto, but the 'method' keyword argument can be
used to overwrite this behavior.
"""
kwargs = kwargs.copy()
kwargs['method'] = method
self.ext_deps.append(dep_type(name, env, kwargs))
def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None,
configtool: T.Optional[str] = None, internal: T.Optional[str] = None,
default_value: T.Optional[str] = None,

@ -105,7 +105,7 @@ class BoostDependency(ExternalDependency):
self.requested_modules = self.get_requested(kwargs)
if 'thread' in self.requested_modules:
if not self._add_sub_dependency2(threads_factory(environment, self.for_machine, {})):
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
self.is_found = False
return

@ -50,7 +50,7 @@ class GTestDependencySystem(ExternalDependency):
super().__init__(name, environment, kwargs, language='cpp')
self.main = kwargs.get('main', False)
self.src_dirs = ['/usr/src/gtest/src', '/usr/src/googletest/googletest/src']
if not self._add_sub_dependency2(threads_factory(environment, self.for_machine, {})):
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
self.is_found = False
return
self.detect()
@ -119,7 +119,7 @@ class GMockDependencySystem(ExternalDependency):
def __init__(self, name: str, environment, kwargs):
super().__init__(name, environment, kwargs, language='cpp')
self.main = kwargs.get('main', False)
if not self._add_sub_dependency2(threads_factory(environment, self.for_machine, {})):
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
self.is_found = False
return
@ -132,7 +132,7 @@ class GMockDependencySystem(ExternalDependency):
# GMock without GTest is pretty much useless
# this also mimics the structure given in WrapDB,
# where GMock always pulls in GTest
found = self._add_sub_dependency2(gtest_factory(environment, self.for_machine, gtest_kwargs))
found = self._add_sub_dependency(gtest_factory(environment, self.for_machine, gtest_kwargs))
if not found:
self.is_found = False
return
@ -235,7 +235,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
self._set_old_link_args()
self.link_args = strip_system_libdirs(environment, self.for_machine, self.link_args)
self.link_args = self.__fix_bogus_link_args(self.link_args)
if not self._add_sub_dependency2(threads_factory(environment, self.for_machine, {})):
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
self.is_found = False
return
@ -400,7 +400,7 @@ class LLVMDependencyCMake(CMakeDependency):
defs = self.traceparser.get_cmake_var('PACKAGE_DEFINITIONS')
temp = ['-I' + x for x in inc_dirs] + defs
self.compile_args += [x for x in temp if x not in self.compile_args]
if not self._add_sub_dependency2(threads_factory(env, self.for_machine, {})):
if not self._add_sub_dependency(threads_factory(env, self.for_machine, {})):
self.is_found = False
return

Loading…
Cancel
Save