forked from Mirror/pmbootstrap
pmb.build: Properly type cross-compilation types (MR 2337)
This commit is contained in:
parent
d6d088b68b
commit
ca6d0eba28
3 changed files with 11 additions and 7 deletions
|
@ -11,6 +11,7 @@ import pmb.helpers.pmaports
|
|||
from pmb.core import Chroot
|
||||
from pmb.core.context import get_context
|
||||
from pmb.meta import Cache
|
||||
from pmb.types import CrossCompileType
|
||||
|
||||
|
||||
# FIXME (#2324): type hint Arch
|
||||
|
@ -93,10 +94,8 @@ def chroot(apkbuild: dict[str, str], arch: Arch) -> Chroot:
|
|||
return Chroot.buildroot(arch)
|
||||
|
||||
|
||||
def crosscompile(apkbuild, arch: Arch):
|
||||
"""
|
||||
:returns: None, "native", "crossdirect"
|
||||
"""
|
||||
def crosscompile(apkbuild, arch: Arch) -> CrossCompileType:
|
||||
"""Decide the type of compilation necessary to build a given APKBUILD."""
|
||||
if not get_context().cross:
|
||||
return None
|
||||
if not arch.cpu_emulation_required():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue