Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android vs third-party libraries #109

Open
nadako opened this issue Feb 3, 2018 · 6 comments
Open

android vs third-party libraries #109

nadako opened this issue Feb 3, 2018 · 6 comments

Comments

@nadako
Copy link
Member

nadako commented Feb 3, 2018

I had to make some changes to turbojpeg/vorbis/libpng to make fmt compile, because the sources included in the repo are stripped and doesn't include support for ARM architectures and specific optimizations (e.g. NEON), which raises a question:

What's the reccomended way to work with these libs? Judging from CMakeFiles, the included third-party libraries are only used on windows, so I guess on android/ios one must use official distros?

@ncannasse
Copy link
Member

Right, the include provided versions are only meant to ease windows compilation. They are also used on consoles, but in that case we disable some of them, for instance by using native hardware supported ZLib/JPG decoding.

@rtissera could you comment on the workflow for Android/Windows, or did you only compile from OSX?

@ncannasse
Copy link
Member

@rtissera
Copy link
Contributor

rtissera commented Feb 5, 2018

@ncannasse @nadako
We are using Android Studio 3.0.1 using CMake build system. We're basically doing all our mobile development on OS X, but I can guess the following instructions should be easy to follow on Windows using MSYS2 or similar system.

Our current build process is still rough for third-party libraries integration and can be vastly improved, but here's a detailed breakdown of what we do so far :

We have a master CMakeLists.txt (template file attached) including source code of the following repositories into our Android project native code :
https://github.com/xiph/vorbis.git
https://github.com/xiph/ogg.git
https://github.com/kcat/openal-soft
https://sourceforge.net/projects/pcre/files/pcre/

We use prebuilt libraries for SDL2 (just use official distro to build them), libpng and libjpeg-turbo by using the following repositories :
https://github.com/julienr/libpng-android.git
https://github.com/openstf/android-libjpeg-turbo.git

Contrary to libpng and libjpeg-turbo, SDL2 is built as a dynamic library so make sure to explicitly load it on the java side (using System.loadLibrary) before anything else.

We have not integrated mbedtls, libuv, OpenSSL, SQLite, neither FFMPEG since we don't use them in our current project but managed to build them on Android from these repositories :

https://github.com/ARMmbed/mbedtls.git
https://github.com/cocochpie/android-openssl.git
https://sqlite.org/android/doc/trunk/www/install.wiki (build AAR, extract libraries from it)
https://github.com/IljaKosynkin/FFmpeg-Development-Kit.git (build process highly depends on the FFMPEG features you want to embed)

And finally libuv can be built from official repo (there's an android-configure script), but the script might need to be patched for newer NDK versions.
https://github.com/libuv/libuv.git

@nadako
Copy link
Member Author

nadako commented Feb 5, 2018

Oh my, that sounds very annoying, anyway thank you!

@waaadim
Copy link

waaadim commented Sep 15, 2021

@nadako - Hi, is your comment above still actual now?

@rainyt
Copy link

rainyt commented Jul 2, 2022

https://github.com/rainyt/zyheaps

here is a library for android/ios easy compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants