UNPKG

2.05 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 = "events",
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/events",
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//jsi:JSIDynamic",
57 "xplat//jsi:jsi",
58 "xplat//third-party/glog:glog",
59 react_native_xplat_target("fabric/debug:debug"),
60 ],
61)
62
63fb_xplat_cxx_test(
64 name = "tests",
65 srcs = glob(["tests/**/*.cpp"]),
66 headers = glob(["tests/**/*.h"]),
67 compiler_flags = [
68 "-fexceptions",
69 "-frtti",
70 "-std=c++14",
71 "-Wall",
72 ],
73 contacts = ["oncall+react_native@xmail.facebook.com"],
74 platforms = (ANDROID, APPLE),
75 deps = [
76 "xplat//folly:molly",
77 "xplat//third-party/gmock:gtest",
78 ":events",
79 ],
80)