mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
60f15d6b5d
Summary: Now we not only measure how many times we measured text but also measure how much time it takes. This way we can see which portion of the layout process is spent by layout itself (and measuring embedded components). Changelog: [Internal] Fabric-specific internal change. Reviewed By: mdvacca Differential Revision: D26827447 fbshipit-source-id: e0b09fcacc86aed50dd94b48458215adbb0a60ef
160 lines
4.4 KiB
Python
160 lines
4.4 KiB
Python
load(
|
|
"//tools/build_defs/oss:rn_defs.bzl",
|
|
"ANDROID",
|
|
"APPLE",
|
|
"CXX",
|
|
"YOGA_CXX_TARGET",
|
|
"fb_xplat_cxx_test",
|
|
"get_apple_compiler_flags",
|
|
"get_apple_inspector_flags",
|
|
"get_preprocessor_flags_for_build_mode",
|
|
"react_native_target",
|
|
"react_native_xplat_target",
|
|
"rn_xplat_cxx_library",
|
|
"subdir_glob",
|
|
)
|
|
|
|
APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
|
|
|
|
rn_xplat_cxx_library(
|
|
name = "textlayoutmanager",
|
|
srcs = glob(
|
|
[
|
|
"*.cpp",
|
|
],
|
|
),
|
|
headers = subdir_glob(
|
|
[
|
|
("", "*.h"),
|
|
],
|
|
prefix = "",
|
|
),
|
|
header_namespace = "",
|
|
exported_headers = subdir_glob(
|
|
[
|
|
("", "*.h"),
|
|
],
|
|
prefix = "react/renderer/textlayoutmanager",
|
|
),
|
|
compiler_flags = [
|
|
"-fexceptions",
|
|
"-frtti",
|
|
"-std=c++14",
|
|
"-Wall",
|
|
],
|
|
cxx_exported_headers = subdir_glob(
|
|
[
|
|
("platform/cxx", "*.h"),
|
|
],
|
|
prefix = "react/renderer/textlayoutmanager",
|
|
),
|
|
cxx_headers = subdir_glob(
|
|
[
|
|
("platform/cxx", "**/*.h"),
|
|
],
|
|
prefix = "",
|
|
),
|
|
cxx_srcs = glob(
|
|
[
|
|
"platform/cxx/**/*.cpp",
|
|
],
|
|
),
|
|
cxx_tests = [":tests"],
|
|
fbandroid_deps = [
|
|
react_native_target("jni/react/jni:jni"),
|
|
],
|
|
fbandroid_exported_headers = subdir_glob(
|
|
[
|
|
("platform/android/react/renderer/textlayoutmanager", "**/*.h"),
|
|
],
|
|
prefix = "react/renderer/textlayoutmanager",
|
|
),
|
|
fbandroid_headers = subdir_glob(
|
|
[
|
|
("platform/android/react/renderer/textlayoutmanager", "**/*.h"),
|
|
],
|
|
prefix = "",
|
|
),
|
|
fbandroid_srcs = glob(
|
|
[
|
|
"platform/android/react/renderer/textlayoutmanager/**/*.cpp",
|
|
],
|
|
),
|
|
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
|
|
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
|
|
force_static = True,
|
|
ios_deps = [
|
|
],
|
|
ios_exported_headers = subdir_glob(
|
|
[
|
|
("platform/ios", "*.h"),
|
|
],
|
|
prefix = "react/renderer/textlayoutmanager",
|
|
),
|
|
ios_frameworks = [
|
|
"$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
|
|
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
|
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
|
],
|
|
ios_headers = subdir_glob(
|
|
[
|
|
("platform/ios", "**/*.h"),
|
|
],
|
|
prefix = "",
|
|
),
|
|
ios_srcs = glob(
|
|
[
|
|
"platform/ios/**/*.cpp",
|
|
"platform/ios/**/*.mm",
|
|
],
|
|
),
|
|
labels = ["supermodule:xplat/default/public.react_native.infra"],
|
|
macosx_tests_override = [],
|
|
platforms = (ANDROID, APPLE, CXX),
|
|
preprocessor_flags = [
|
|
"-DLOG_TAG=\"ReactNative\"",
|
|
"-DWITH_FBSYSTRACE=1",
|
|
],
|
|
visibility = ["PUBLIC"],
|
|
deps = [
|
|
"//third-party/glog:glog",
|
|
"//xplat/fbsystrace:fbsystrace",
|
|
"//xplat/folly:headers_only",
|
|
"//xplat/folly:memory",
|
|
"//xplat/folly:molly",
|
|
YOGA_CXX_TARGET,
|
|
react_native_xplat_target("react/renderer/attributedstring:attributedstring"),
|
|
react_native_xplat_target("react/renderer/core:core"),
|
|
react_native_xplat_target("react/utils:utils"),
|
|
react_native_xplat_target("react/renderer/debug:debug"),
|
|
react_native_xplat_target("react/renderer/graphics:graphics"),
|
|
react_native_xplat_target("react/renderer/uimanager:uimanager"),
|
|
react_native_xplat_target("react/renderer/mounting:mounting"),
|
|
react_native_xplat_target("react/renderer/componentregistry:componentregistry"),
|
|
],
|
|
)
|
|
|
|
fb_xplat_cxx_test(
|
|
name = "tests",
|
|
srcs = glob(["tests/**/*.cpp"]),
|
|
headers = glob(["tests/**/*.h"]),
|
|
compiler_flags = [
|
|
"-fexceptions",
|
|
"-frtti",
|
|
"-std=c++14",
|
|
"-Wall",
|
|
],
|
|
contacts = ["oncall+react_native@xmail.facebook.com"],
|
|
platforms = (
|
|
# `Apple` and `Android` flavors are disabled because the module (built with those flavors) requires Emulator/Simulator (which is expensive and slow). At the same time, we don't really have tests here.
|
|
# ANDROID,
|
|
# APPLE,
|
|
CXX,
|
|
),
|
|
deps = [
|
|
":textlayoutmanager",
|
|
"//xplat/folly:molly",
|
|
"//xplat/third-party/gmock:gtest",
|
|
],
|
|
)
|