UNPKG

2.17 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_xplat_target",
10 "rn_xplat_cxx_library",
11 "subdir_glob",
12)
13
14APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
15
16rn_xplat_cxx_library(
17 name = "mounting",
18 srcs = glob(
19 ["**/*.cpp"],
20 exclude = glob(["tests/**/*.cpp"]),
21 ),
22 headers = glob(
23 ["**/*.h"],
24 exclude = glob(["tests/**/*.h"]),
25 ),
26 header_namespace = "",
27 exported_headers = subdir_glob(
28 [
29 ("", "*.h"),
30 ],
31 prefix = "react/mounting",
32 ),
33 compiler_flags = [
34 "-fexceptions",
35 "-frtti",
36 "-std=c++14",
37 "-Wall",
38 ],
39 fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
40 fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
41 force_static = True,
42 macosx_tests_override = [],
43 platforms = (ANDROID, APPLE),
44 preprocessor_flags = [
45 "-DLOG_TAG=\"ReactNative\"",
46 # Systraces are temporary disabled.
47 # "-DWITH_FBSYSTRACE=1",
48 ],
49 tests = [":tests"],
50 visibility = ["PUBLIC"],
51 deps = [
52 "xplat//fbsystrace:fbsystrace",
53 "xplat//folly:headers_only",
54 "xplat//folly:memory",
55 "xplat//folly:molly",
56 "xplat//third-party/glog:glog",
57 react_native_xplat_target("better:better"),
58 react_native_xplat_target("fabric/core:core"),
59 react_native_xplat_target("fabric/debug:debug"),
60 react_native_xplat_target("fabric/events:events"),
61 ],
62)
63
64fb_xplat_cxx_test(
65 name = "tests",
66 srcs = glob(["tests/**/*.cpp"]),
67 headers = glob(["tests/**/*.h"]),
68 compiler_flags = [
69 "-fexceptions",
70 "-frtti",
71 "-std=c++14",
72 "-Wall",
73 ],
74 contacts = ["oncall+react_native@xmail.facebook.com"],
75 platforms = (ANDROID, APPLE),
76 deps = [
77 "xplat//folly:molly",
78 "xplat//third-party/gmock:gtest",
79 ":mounting",
80 ],
81)