python/build/toolchain.py: add AnyToolchain for type hints

This commit is contained in:
Max Kellermann
2023-09-26 12:47:44 +02:00
parent 4669f7e2b9
commit 5f253e66f6
9 changed files with 39 additions and 27 deletions

@ -2,6 +2,7 @@ import os.path, subprocess, sys
from typing import Collection, Iterable, Optional
from build.makeproject import MakeProject
from .toolchain import AnyToolchain
class AutotoolsProject(MakeProject):
def __init__(self, url: str, md5: str, installed: str,
@ -22,7 +23,7 @@ class AutotoolsProject(MakeProject):
self.libs = libs
self.subdirs = subdirs
def configure(self, toolchain) -> str:
def configure(self, toolchain: AnyToolchain) -> str:
src = self.unpack(toolchain)
if self.autogen:
if sys.platform == 'darwin':
@ -70,7 +71,7 @@ class AutotoolsProject(MakeProject):
return build
def _build(self, toolchain) -> None:
def _build(self, toolchain: AnyToolchain) -> None:
build = self.configure(toolchain)
if self.subdirs is not None:
for subdir in self.subdirs: