def add_deps(self, deps):
    deps = listify(deps)
    for dep in deps:
        if hasattr(dep, 'held_object'):
            dep = dep.held_object
        if isinstance(dep, dependencies.InternalDependency):
            self.process_sourcelist(dep.sources)
            self.add_include_dirs(dep.include_directories)
            for l in dep.libraries:
                self.link(l)
            for l in dep.whole_libraries:
                self.link_whole(l)
            if (dep.compile_args or dep.link_args):
                extpart = dependencies.InternalDependency('undefined', [], dep.compile_args, dep.link_args, [], [], [], [])
                self.external_deps.append(extpart)
            self.add_deps(dep.ext_deps)
        elif isinstance(dep, dependencies.Dependency):
            self.external_deps.append(dep)
            self.process_sourcelist(dep.get_sources())
        elif isinstance(dep, BuildTarget):
            raise InvalidArguments('Tried to use a build target as a dependency.\nYou probably should put it in link_with instead.')
        else:
            if (hasattr(dep, 'project_args_frozen') or hasattr(dep, 'global_args_frozen')):
                raise InvalidArguments('Tried to use subproject object as a dependency.\nYou probably wanted to use a dependency declared in it instead.\nAccess it by calling get_variable() on the subproject object.')
            raise InvalidArguments('Argument is of an unacceptable type {!r}.\nMust be either an external dependency (returned by find_library() or dependency()) or an internal dependency (returned by declare_dependency()).'.format(type(dep).__name__))
def add_deps(self, deps):
    deps = listify(deps)
    for dep in deps:
        if hasattr(dep, 'held_object'):
            dep = dep.held_object
        if isinstance(dep, dependencies.InternalDependency):
            self.process_sourcelist(dep.sources)
            self.add_include_dirs(dep.include_directories)
            for l in dep.libraries:
                self.link(l)
            for l in dep.whole_libraries:
                self.link_whole(l)
            if (dep.compile_args or dep.link_args):
                extpart = dependencies.InternalDependency('undefined', [], dep.compile_args, dep.link_args, [], [], [], [])
                self.external_deps.append(extpart)
            self.add_deps(dep.ext_deps)
        elif isinstance(dep, dependencies.Dependency):
            self.external_deps.append(dep)
            self.process_sourcelist(dep.get_sources())
        elif isinstance(dep, BuildTarget):
            raise InvalidArguments('Tried to use a build target as a dependency.\nYou probably should put it in link_with instead.')
        else:
            if (hasattr(dep, 'project_args_frozen') or hasattr(dep, 'global_args_frozen')):
                raise InvalidArguments('Tried to use subproject object as a dependency.\nYou probably wanted to use a dependency declared in it instead.\nAccess it by calling get_variable() on the subproject object.')
            raise InvalidArguments('Argument is of an unacceptable type {!r}.\nMust be either an external dependency (returned by find_library() or dependency()) or an internal dependency (returned by declare_dependency()).'.format(type(dep).__name__))