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    "rn_xplat_cxx_library",
10    "subdir_glob",
11)
12
13APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
14
15rn_xplat_cxx_library(
16    name = "butter",
17    srcs = glob(
18        ["**/*.cpp"],
19        exclude = glob(["tests/**/*.cpp"]),
20    ),
21    headers = glob(
22        ["**/*.h"],
23        exclude = glob(["tests/**/*.h"]),
24    ),
25    header_namespace = "",
26    exported_headers = subdir_glob(
27        [
28            ("", "*.h"),
29        ],
30        prefix = "butter",
31    ),
32    compiler_flags_pedantic = True,
33    fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
34    fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
35    force_static = True,
36    labels = [
37        "pfh:ReactNative_CommonInfrastructurePlaceholder",
38    ],
39    macosx_tests_override = [],
40    platforms = (ANDROID, APPLE, CXX),
41    preprocessor_flags = [
42        "-DLOG_TAG=\"ReactNative\"",
43        "-DWITH_FBSYSTRACE=1",
44    ],
45    tests = [],
46    visibility = ["PUBLIC"],
47    deps = [
48        "//third-party/glog:glog",
49        "//xplat/fbsystrace:fbsystrace",
50        "//xplat/folly:container_f14_hash",
51        "//xplat/folly:memory",
52        "//xplat/folly:shared_mutex",
53        "//xplat/folly:small_vector",
54    ],
55)
56