1load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_preprocessor_flags_for_build_mode")
2load(
3    "//tools/build_defs/oss:rn_defs.bzl",
4    "ANDROID",
5    "APPLE",
6    "CXX",
7    "fb_xplat_cxx_test",
8    "get_apple_compiler_flags",
9    "get_apple_inspector_flags",
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 = "timeline",
19    srcs = glob(
20        ["**/*.cpp"],
21        exclude = glob(["tests/**/*.cpp"]),
22    ),
23    headers = glob(
24        ["**/*.h"],
25        exclude = glob(["tests/**/*.h"]),
26    ),
27    header_namespace = "",
28    exported_headers = subdir_glob(
29        [
30            ("", "*.h"),
31        ],
32        prefix = "react/renderer/timeline",
33    ),
34    fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
35    fbobjc_labels = ["supermodule:ios/isolation/infra.react_native"],
36    fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
37    force_static = True,
38    macosx_tests_override = [],
39    platforms = (ANDROID, APPLE, CXX),
40    preprocessor_flags = [
41        "-DLOG_TAG=\"ReactNative\"",
42        "-DWITH_FBSYSTRACE=1",
43    ],
44    tests = [":tests"],
45    visibility = ["PUBLIC"],
46    deps = [
47        "//third-party/glog:glog",
48        "//xplat/fbsystrace:fbsystrace",
49        "//xplat/folly:headers_only_do_not_use",
50        "//xplat/folly:memory",
51        "//xplat/folly:molly",
52        react_native_xplat_target("react/utils:utils"),
53        react_native_xplat_target("react/renderer/debug:debug"),
54        react_native_xplat_target("react/renderer/core:core"),
55        react_native_xplat_target("react/renderer/components/root:root"),
56        react_native_xplat_target("react/renderer/mounting:mounting"),
57        react_native_xplat_target("react/renderer/uimanager:uimanager"),
58    ],
59)
60
61fb_xplat_cxx_test(
62    name = "tests",
63    srcs = glob(["tests/**/*.cpp"]),
64    headers = glob(["tests/**/*.h"]),
65    compiler_flags = [
66        "-fexceptions",
67        "-frtti",
68        "-std=c++17",
69        "-Wall",
70    ],
71    contacts = ["[email protected]"],
72    platforms = (ANDROID, APPLE, CXX),
73    deps = [
74        ":timeline",
75        "//xplat/folly:molly",
76        "//xplat/third-party/gmock:gtest",
77    ],
78)
79