1load(
2    "//tools/build_defs/oss:rn_defs.bzl",
3    "ANDROID",
4    "APPLE",
5    "CXX",
6    "get_apple_compiler_flags",
7    "get_apple_inspector_flags",
8    "get_preprocessor_flags_for_build_mode",
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 = "componentregistry",
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/renderer/componentregistry",
32    ),
33    compiler_flags_pedantic = True,
34    fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
35    fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
36    force_static = True,
37    labels = [
38        "pfh:ReactNative_CommonInfrastructurePlaceholder",
39    ],
40    macosx_tests_override = [],
41    platforms = (ANDROID, APPLE, CXX),
42    preprocessor_flags = [
43        "-DLOG_TAG=\"ReactNative\"",
44        "-DWITH_FBSYSTRACE=1",
45    ],
46    visibility = ["PUBLIC"],
47    deps = [
48        react_native_xplat_target("react/debug:debug"),
49        react_native_xplat_target("react/renderer/core:core"),
50        react_native_xplat_target("react/renderer/debug:debug"),
51        react_native_xplat_target("react/utils:utils"),
52    ],
53)
54