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 = "debug",
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 = "react/debug",
31    ),
32    exported_platform_linker_flags = [
33        (
34            "^android.*",
35            ["-llog"],
36        ),
37    ],
38    fbandroid_linker_flags = [
39        # for android react_native_assert
40        "-llog",
41    ],
42    fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
43    fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
44    force_static = True,
45    labels = [
46        "pfh:ReactNative_CommonInfrastructurePlaceholder",
47        "supermodule:xplat/default/public.react_native.infra",
48    ],
49    macosx_tests_override = [],
50    platforms = (ANDROID, APPLE, CXX),
51    preprocessor_flags = [
52        "-DLOG_TAG=\"ReactNative\"",
53        "-DWITH_FBSYSTRACE=1",
54    ],
55    tests = [],
56    visibility = ["PUBLIC"],
57    deps = [
58        "//xplat/fbsystrace:fbsystrace",
59        "//xplat/folly:headers_only_do_not_use",
60        "//xplat/folly:memory",
61        "//xplat/folly:molly",
62    ],
63    exported_deps = [
64        "//third-party/glog:glog",
65    ],
66)
67