Skip to content

Commit 15022bc

Browse files
committed
Added a minimum supported ndk api check to the python3 recipe
1 parent bb9f067 commit 15022bc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pythonforandroid/recipes/python3/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pythonforandroid.recipe import TargetPythonRecipe
22
from pythonforandroid.toolchain import shprint, current_directory
3-
from pythonforandroid.logger import logger, info
3+
from pythonforandroid.logger import logger, info, error
44
from pythonforandroid.util import ensure_dir, walk_valid_filens
55
from os.path import exists, join, dirname
66
from os import environ
@@ -39,9 +39,16 @@ class Python3Recipe(TargetPythonRecipe):
3939

4040
depends = ['hostpython3']
4141
conflicts = ['python3crystax', 'python2']
42-
# opt_depends = ['openssl', 'sqlite3']
42+
43+
# This recipe can be built only against API 21+
44+
MIN_NDK_API = 21
4345

4446
def build_arch(self, arch):
47+
if self.ctx.ndk_api < self.MIN_NDK_API:
48+
error('Target ndk-api is {}, but the python3 recipe supports only {}+'.format(
49+
self.ctx.ndk_api, self.MIN_NDK_API))
50+
exit(1)
51+
4552
recipe_build_dir = self.get_build_dir(arch.arch)
4653

4754
# Create a subdirectory to actually perform the build

0 commit comments

Comments
 (0)