python/build/toolchain.py: add AnyToolchain for type hints
This commit is contained in:
@ -2,6 +2,7 @@ import subprocess, multiprocessing
|
||||
from typing import Optional
|
||||
|
||||
from build.project import Project
|
||||
from .toolchain import AnyToolchain
|
||||
|
||||
class MakeProject(Project):
|
||||
def __init__(self, url: str, md5: str, installed: str,
|
||||
@ -18,17 +19,17 @@ class MakeProject(Project):
|
||||
# default to 12, if multiprocessing.cpu_count() is not implemented
|
||||
return 12
|
||||
|
||||
def get_make_args(self, toolchain) -> list[str]:
|
||||
def get_make_args(self, toolchain: AnyToolchain) -> list[str]:
|
||||
return ['--quiet', '-j' + str(self.get_simultaneous_jobs())]
|
||||
|
||||
def get_make_install_args(self, toolchain) -> list[str]:
|
||||
def get_make_install_args(self, toolchain: AnyToolchain) -> list[str]:
|
||||
return ['--quiet', self.install_target]
|
||||
|
||||
def make(self, toolchain, wd: str, args: list[str]) -> None:
|
||||
def make(self, toolchain: AnyToolchain, wd: str, args: list[str]) -> None:
|
||||
subprocess.check_call(['make'] + args,
|
||||
cwd=wd, env=toolchain.env)
|
||||
|
||||
def build_make(self, toolchain, wd: str, install: bool=True) -> None:
|
||||
def build_make(self, toolchain: AnyToolchain, wd: str, install: bool=True) -> None:
|
||||
self.make(toolchain, wd, self.get_make_args(toolchain))
|
||||
if install:
|
||||
self.make(toolchain, wd, self.get_make_install_args(toolchain))
|
||||
|
Reference in New Issue
Block a user