Skip to content

Commit 8903522

Browse files
authored
Merge pull request kivy#2482 from AndyRusso/sdl2_rebuilding
Add should_build method to sdl2 recipe
2 parents 77d2629 + 9875ff4 commit 8903522

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pythonforandroid/recipes/sdl2/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from os.path import exists, join
2+
13
from pythonforandroid.recipe import BootstrapNDKRecipe
24
from pythonforandroid.toolchain import current_directory, shprint
35
import sh
@@ -18,6 +20,15 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True, with_python=True):
1820
env['APP_ALLOW_MISSING_DEPS'] = 'true'
1921
return env
2022

23+
def should_build(self, arch):
24+
libdir = join(
25+
self.get_build_dir(arch.arch),
26+
'../..',
27+
'libs', arch.arch
28+
)
29+
libs = ['libhidapi.so', 'libmain.so', 'libSDL2.so', 'libSDL2_image.so', 'libSDL2_mixer.so', 'libSDL2_ttf.so']
30+
return not all(exists(join(libdir, x)) for x in libs)
31+
2132
def build_arch(self, arch):
2233
env = self.get_recipe_env(arch)
2334

0 commit comments

Comments
 (0)