Skip to content

Commit

Permalink
Merge pull request #1757 from goffi-contrib/protobuf_runtime_fix
Browse files Browse the repository at this point in the history
[protobuf_cpp] fixed runtime issues
  • Loading branch information
AndreMiras authored Mar 16, 2019
2 parents 84142eb + 486983d commit 2f4cf91
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pythonforandroid/recipes/protobuf_cpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def build_arch(self, arch):
# Install python bindings
self.install_python_package(arch)

# Create __init__.py which is missing (cf. https://github.com/protocolbuffers/protobuf/issues/1296
# and https://stackoverflow.com/questions/13862562/google-protocol-buffers-not-found-when-trying-to-freeze-python-app)
open(join(self.ctx.get_site_packages_dir(), 'google', '__init__.py'), 'a').close()

def install_python_package(self, arch):
env = self.get_recipe_env(arch)

Expand Down Expand Up @@ -132,11 +136,10 @@ def get_recipe_env(self, arch):
env['CXXFLAGS'] += ' -frtti'
env['CXXFLAGS'] += ' -fexceptions'
env['LDFLAGS'] += (
' -lgnustl_shared -landroid -llog' +
' -L' + self.ctx.ndk_dir +
'/sources/cxx-stl/gnu-libstdc++/' + self.ctx.toolchain_version +
'/libs/' + arch.arch)
env['LIBS'] = env.get('LIBS', '') + ' -lgnustl_shared -landroid -llog'

return env


Expand Down

0 comments on commit 2f4cf91

Please sign in to comment.