Summary: Yoga's JNI bindings are usually loaded during class loading, and can stall the UI thread. Here, we try to mitigate the problem by adding the bindings to libcoldstart. Reviewed By: michalgr Differential Revision: D12956818 fbshipit-source-id: 9dda5cb6d26c2bae64606bc2d7c98ab8f7c05a30
74 lines
1.8 KiB
Python
74 lines
1.8 KiB
Python
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID", "CXX_LIBRARY_WHITELIST", "FBJNI_JAVA_TARGET", "FBJNI_TARGET", "INFER_ANNOTATIONS_TARGET", "JNI_TARGET", "JSR_305_TARGET", "JUNIT_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "yoga_cxx_library", "yoga_dep", "yoga_java_binary", "yoga_java_library", "yoga_java_test")
|
|
|
|
yoga_cxx_library(
|
|
name = "jni",
|
|
srcs = glob(["jni/*.cpp"]),
|
|
headers = glob(["jni/*.h"]),
|
|
header_namespace = "",
|
|
allow_jni_merging = True,
|
|
compiler_flags = [
|
|
"-fno-omit-frame-pointer",
|
|
"-fexceptions",
|
|
"-fPIC",
|
|
"-Wall",
|
|
"-Werror",
|
|
"-O3",
|
|
"-std=c++11",
|
|
],
|
|
platforms = ANDROID,
|
|
preprocessor_flags = [
|
|
"-DFBJNI_WITH_FAST_CALLS",
|
|
],
|
|
soname = "libyoga.$(ext)",
|
|
visibility = ["PUBLIC"],
|
|
deps = [
|
|
FBJNI_TARGET,
|
|
JNI_TARGET,
|
|
yoga_dep(":yoga"),
|
|
],
|
|
)
|
|
|
|
yoga_java_library(
|
|
name = "java",
|
|
srcs = glob(["com/facebook/yoga/*.java"]),
|
|
required_for_source_only_abi = True,
|
|
source = "1.7",
|
|
target = "1.7",
|
|
tests = [
|
|
yoga_dep("java:tests"),
|
|
],
|
|
visibility = ["PUBLIC"],
|
|
deps = [
|
|
":jni",
|
|
INFER_ANNOTATIONS_TARGET,
|
|
JSR_305_TARGET,
|
|
PROGRUARD_ANNOTATIONS_TARGET,
|
|
SOLOADER_TARGET,
|
|
],
|
|
)
|
|
|
|
yoga_java_test(
|
|
name = "tests",
|
|
srcs = glob(["tests/**/*.java"]),
|
|
cxx_library_whitelist = CXX_LIBRARY_WHITELIST,
|
|
use_cxx_libraries = True,
|
|
visibility = ["PUBLIC"],
|
|
deps = [
|
|
":java",
|
|
JUNIT_TARGET,
|
|
],
|
|
)
|
|
|
|
yoga_java_binary(
|
|
name = "yoga",
|
|
deps = [
|
|
":java",
|
|
FBJNI_JAVA_TARGET,
|
|
],
|
|
)
|