UNPKG

3.42 kBPlain TextView Raw
1load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_debug_preprocessor_flags")
2load(
3 "//tools/build_defs/oss:rn_defs.bzl",
4 "ANDROID",
5 "APPLE",
6 "fb_xplat_cxx_test",
7 "get_apple_compiler_flags",
8 "get_apple_inspector_flags",
9 "react_native_target",
10 "react_native_xplat_target",
11 "rn_xplat_cxx_library",
12 "subdir_glob",
13)
14
15APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
16
17rn_xplat_cxx_library(
18 name = "textlayoutmanager",
19 srcs = glob(
20 [
21 "*.cpp",
22 ],
23 ),
24 headers = subdir_glob(
25 [
26 ("", "*.h"),
27 ],
28 prefix = "",
29 ),
30 header_namespace = "",
31 exported_headers = subdir_glob(
32 [
33 ("", "*.h"),
34 ],
35 prefix = "react/textlayoutmanager",
36 ),
37 compiler_flags = [
38 "-fexceptions",
39 "-frtti",
40 "-std=c++14",
41 "-Wall",
42 ],
43 fbandroid_deps = [
44 react_native_target("jni/react/jni:jni"),
45 ],
46 fbandroid_exported_headers = subdir_glob(
47 [
48 ("", "*.h"),
49 ("platform/android", "*.h"),
50 ],
51 prefix = "react/textlayoutmanager",
52 ),
53 fbandroid_headers = subdir_glob(
54 [
55 ("platform/android", "**/*.h"),
56 ],
57 prefix = "",
58 ),
59 fbandroid_srcs = glob(
60 [
61 "platform/android/**/*.cpp",
62 ],
63 ),
64 fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
65 fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
66 force_static = True,
67 ios_deps = [
68 ],
69 ios_exported_headers = subdir_glob(
70 [
71 ("platform/ios", "*.h"),
72 ],
73 prefix = "react/textlayoutmanager",
74 ),
75 ios_frameworks = [
76 "$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
77 "$SDKROOT/System/Library/Frameworks/Foundation.framework",
78 "$SDKROOT/System/Library/Frameworks/UIKit.framework",
79 ],
80 ios_headers = subdir_glob(
81 [
82 ("platform/ios", "**/*.h"),
83 ],
84 prefix = "",
85 ),
86 ios_srcs = glob(
87 [
88 "platform/ios/**/*.cpp",
89 "platform/ios/**/*.mm",
90 ],
91 ),
92 macosx_tests_override = [],
93 platforms = (ANDROID, APPLE),
94 preprocessor_flags = [
95 "-DLOG_TAG=\"ReactNative\"",
96 "-DWITH_FBSYSTRACE=1",
97 ],
98 tests = [":tests"],
99 visibility = ["PUBLIC"],
100 deps = [
101 "xplat//fbsystrace:fbsystrace",
102 "xplat//folly:headers_only",
103 "xplat//folly:memory",
104 "xplat//folly:molly",
105 "xplat//third-party/glog:glog",
106 "xplat//yoga:yoga",
107 react_native_xplat_target("fabric/attributedstring:attributedstring"),
108 react_native_xplat_target("fabric/core:core"),
109 react_native_xplat_target("fabric/debug:debug"),
110 react_native_xplat_target("fabric/graphics:graphics"),
111 react_native_xplat_target("fabric/uimanager:uimanager"),
112 ],
113)
114
115fb_xplat_cxx_test(
116 name = "tests",
117 srcs = glob(["tests/**/*.cpp"]),
118 headers = glob(["tests/**/*.h"]),
119 compiler_flags = [
120 "-fexceptions",
121 "-frtti",
122 "-std=c++14",
123 "-Wall",
124 ],
125 contacts = ["oncall+react_native@xmail.facebook.com"],
126 platforms = (ANDROID, APPLE),
127 deps = [
128 "xplat//folly:molly",
129 "xplat//third-party/gmock:gtest",
130 ":textlayoutmanager",
131 ],
132)