Enhance build process

Summary:
After building yoga aar, we found several issues:
1. More dynamic so files. This is bad as lower-end Android devices cannot load that many sos.
2. Size increase.
3. (Minor) The libs are stored in asset folder rather than "libs/".

We apply the following optimizations:
1. Remove dependency on memalign16 (this is brought in by a pure header dependency jni-hack);
2. Enable native relinker to remove unused symbols in the so files.
3. Link yogacore statically to reduce size churn.

Differential Revision: D20808623

fbshipit-source-id: dfbf86525bd90a097348a15a663db2381ade3ba3
This commit is contained in:
Gavin Weng
2020-04-06 02:16:03 -07:00
committed by Facebook GitHub Bot
parent 2049c85a6c
commit 4687791a27
4 changed files with 30 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID", "CXX_LIBRARY_WHITELIST",
CXX_LIBRARY_WHITELIST_FOR_TESTS = CXX_LIBRARY_WHITELIST + [
yoga_cxx_lib("testutil:jni"),
yoga_cxx_lib("testutil:testutil"),
yoga_cxx_lib("testutil:testutil-jni"),
]
YOGA_JAVA_IMPLEMENTATION_FILES = [
@@ -54,7 +54,7 @@ yoga_cxx_library(
visibility = ["PUBLIC"],
deps = [
JNI_TARGET,
yoga_dep(":yoga"),
yoga_dep(":yoga-static"),
":ndklog",
],
)