Skip to content

Commit 7c6e6f3

Browse files
lazycat11lanmaokuzeyron
authored
Fix android recipe linking with Qt bootstrap (#3312)
Co-authored-by: lanmao <lanmao.w@qq.co> Co-authored-by: Mathias Lindström <8863149+kuzeyron@users.noreply.github.com>
1 parent 4174efe commit 7c6e6f3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

pythonforandroid/recipes/android/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class AndroidRecipe(IncludedFilesBehaviour, PyProjectRecipe):
2020
def get_recipe_env(self, arch, **kwargs):
2121
env = super().get_recipe_env(arch, **kwargs)
2222
env.update(self.config_env)
23+
24+
if self.ctx.bootstrap.name == "qt":
25+
env['ANDROID_MAIN_LIB'] = f'main_{arch.arch}'
26+
2327
return env
2428

2529
def prebuild_arch(self, arch):
@@ -50,8 +54,9 @@ def prebuild_arch(self, arch):
5054
'IS_SDL2': int(bootstrap_name == "sdl2"),
5155
'IS_SDL3': int(bootstrap_name == "sdl3"),
5256
'PY2': 0,
53-
'ANDROID_LIBS_DIR': "{}:{}".format(
57+
'ANDROID_LIBS_DIR': "{}:{}:{}".format(
5458
self.ctx.get_libs_dir(arch.arch),
59+
join(self.ctx.bootstrap.build_dir, 'libs', arch.arch),
5560
join(self.ctx.bootstrap.build_dir, 'obj', 'local', arch.arch)
5661
),
5762
'JAVA_NAMESPACE': java_ns,

pythonforandroid/recipes/android/src/setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf'],
88
'sdl3': ['SDL3', 'SDL3_image', 'SDL3_mixer', 'SDL3_ttf'],
99
}
10-
sdl_libs = lib_dict.get(os.environ['BOOTSTRAP'], ['main'])
10+
sdl_libs = lib_dict.get(
11+
os.environ['BOOTSTRAP'],
12+
[os.environ.get('ANDROID_MAIN_LIB', 'main')]
13+
)
1114

1215
modules = [
1316
Extension('android._android',

0 commit comments

Comments
 (0)