Skip to content

Commit 6783b1d

Browse files
committed
[recipe-stl] Make CppCompiledComponentsPythonRecipe use Recipe's STL support
1 parent 1584f40 commit 6783b1d

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

pythonforandroid/recipe.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -982,35 +982,7 @@ def rebuild_compiled_components(self, arch, env):
982982
class CppCompiledComponentsPythonRecipe(CompiledComponentsPythonRecipe):
983983
""" Extensions that require the cxx-stl """
984984
call_hostpython_via_targetpython = False
985-
986-
def get_recipe_env(self, arch):
987-
env = super(CppCompiledComponentsPythonRecipe, self).get_recipe_env(arch)
988-
keys = dict(
989-
ctx=self.ctx,
990-
arch=arch,
991-
arch_noeabi=arch.arch.replace('eabi', '')
992-
)
993-
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
994-
env['CFLAGS'] += (
995-
" -I{ctx.ndk_dir}/platforms/android-{ctx.android_api}/arch-{arch_noeabi}/usr/include" +
996-
" -I{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/include" +
997-
" -I{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/include").format(**keys)
998-
env['CXXFLAGS'] = env['CFLAGS'] + ' -frtti -fexceptions'
999-
env['LDFLAGS'] += (
1000-
" -L{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}" +
1001-
" -lgnustl_shared").format(**keys)
1002-
1003-
return env
1004-
1005-
def build_compiled_components(self, arch):
1006-
super(CppCompiledComponentsPythonRecipe, self).build_compiled_components(arch)
1007-
1008-
# Copy libgnustl_shared.so
1009-
with current_directory(self.get_build_dir(arch.arch)):
1010-
sh.cp(
1011-
"{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/libgnustl_shared.so".format(ctx=self.ctx, arch=arch),
1012-
self.ctx.get_libs_dir(arch.arch)
1013-
)
985+
need_stl_shared = True
1014986

1015987

1016988
class CythonRecipe(PythonRecipe):

0 commit comments

Comments
 (0)