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

[FR] Provide static libraries as well #110

Open
bk138 opened this issue Jul 12, 2020 · 5 comments
Open

[FR] Provide static libraries as well #110

bk138 opened this issue Jul 12, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@bk138
Copy link

bk138 commented Jul 12, 2020

Is your feature request related to a problem? Please describe.
While linking an Android app's native code to .so files works reasonably well, there are a lot of unused symbols shipped in the resulting .apk, contained in the .so files.

Describe the solution you'd like
The AAR packages provide .a files as well, allowing linking to those and, as a result, allowing the compiling/linking machinery to strip symbols that aren't actually used by the program code, resulting in smaller .apk's.

Thus, an AAR would contain headers, static and dynamic libs, very much like Linux distros do it,

Describe alternatives you've considered
Right now we're building all dependencies as static libs from source.

Additional context
https://github.com/bk138/multivnc/blob/master/android/app/src/main/cpp/CMakeLists.txt is the project in question - would be nice to use static prefabs there :-).

@bk138 bk138 added the enhancement New feature or request label Jul 12, 2020
@DanAlbert
Copy link
Member

I've been meaning to find the time for this. Is there a particular package you want this for, or just in general?

@bk138
Copy link
Author

bk138 commented Jul 12, 2020

OpenSSL would be nice for a start. Nonetheless, I reckon this would come in handy generally, too.

@alexcohn
Copy link

alexcohn commented Sep 20, 2020

Yes, you can use static libraries with prefab. You can have static and shared libraries in the same prefab. The names of the static and shared library files can be the same (e.g. libssl.so and libssl.a), but the directory names under modules and library names in module.json must be different (e.g. libssl and libssl-static).

The only inconvenience is that you must include the headers twice, but @DanAlbert has been convincing me all along that duplication of some files in the AAR is not a problem at all.

@mrousavy

This comment has been minimized.

@bk138

This comment has been minimized.

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

No branches or pull requests

4 participants