Files
yoga/java/BUCK
Aniket Mathur 477fedd1b6 Rollout to xplat/{t..z}
Reviewed By: mzlee

Differential Revision: D33810211

fbshipit-source-id: c1a437a3834701d79461365ef503eee9fa4e75bd
2022-01-31 17:02:01 -08:00

128 lines
3.0 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", "CXX_LIBRARY_WHITELIST", "JNI_TARGET", "JSR_305_TARGET", "JUNIT_TARGET", "PROGUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "YOGA_ROOTS", "yoga_android_dep", "yoga_cxx_library", "yoga_dep", "yoga_java_binary", "yoga_java_library", "yoga_java_test", "yoga_prebuilt_cxx_library")
CXX_LIBRARY_WHITELIST_FOR_TESTS = CXX_LIBRARY_WHITELIST + [
yoga_android_dep("testutil:jni"),
yoga_android_dep("testutil:testutil-jni"),
]
YOGA_JAVA_IMPLEMENTATION_FILES = [
"com/facebook/yoga/*JNI*.java",
"com/facebook/yoga/*Factory.java",
"com/facebook/yoga/YogaNative.java",
]
yoga_prebuilt_cxx_library(
name = "ndklog",
exported_platform_linker_flags = [
(
"^android.*",
["-llog"],
),
],
header_only = True,
visibility = YOGA_ROOTS,
)
yoga_cxx_library(
name = "jni",
srcs = glob(["jni/*.cpp"]),
header_namespace = "yoga/java",
exported_headers = glob(["jni/*.h"]),
allow_jni_merging = True,
compiler_flags = [
"-fno-omit-frame-pointer",
"-fexceptions",
"-fvisibility=hidden",
"-ffunction-sections",
"-fdata-sections",
"-fPIC",
"-Wall",
"-Werror",
"-Os",
"-std=c++11",
],
platforms = (CXX, ANDROID),
preprocessor_flags = [
"-DFBJNI_WITH_FAST_CALLS",
],
soname = "libyoga.$(ext)",
visibility = ["PUBLIC"],
deps = [
JNI_TARGET,
yoga_dep(":yoga-static"),
":ndklog",
],
)
yoga_java_library(
name = "java-interface",
srcs = glob(
["com/facebook/yoga/*.java"],
exclude = YOGA_JAVA_IMPLEMENTATION_FILES,
),
required_for_source_only_abi = True,
source = "1.7",
target = "1.7",
visibility = ["PUBLIC"],
deps = [
JSR_305_TARGET,
PROGUARD_ANNOTATIONS_TARGET,
],
)
yoga_java_library(
name = "java-impl",
srcs = glob(YOGA_JAVA_IMPLEMENTATION_FILES),
required_for_source_only_abi = True,
source = "1.7",
target = "1.7",
deps = [
":java-interface",
":jni",
JSR_305_TARGET,
PROGUARD_ANNOTATIONS_TARGET,
SOLOADER_TARGET,
],
)
yoga_java_library(
name = "java",
required_for_source_only_abi = True,
source = "1.7",
target = "1.7",
tests = [
yoga_dep("java:tests"),
],
visibility = ["PUBLIC"],
exported_deps = [
":java-impl",
":java-interface",
],
)
yoga_java_test(
name = "tests",
srcs = glob(["tests/**/*.java"]),
contacts = ["oncall+yoga@xmail.facebook.com"],
cxx_library_whitelist = CXX_LIBRARY_WHITELIST_FOR_TESTS,
use_cxx_libraries = True,
visibility = ["PUBLIC"],
deps = [
":java",
yoga_dep("testutil:java"),
JUNIT_TARGET,
],
)
yoga_java_binary(
name = "yoga",
deps = [
":java",
],
)