1load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "APPLE", "CXX", "IOS", "MACOSX", "fb_xplat_cxx_test", "react_native_xplat_shared_library_target", "react_native_xplat_target", "rn_xplat_cxx_library")
2
3rn_xplat_cxx_library(
4    name = "bridging",
5    srcs = glob(["*.cpp"]),
6    header_namespace = "react/bridging",
7    exported_headers = glob(["*.h"]),
8    compiler_flags_enable_exceptions = True,
9    compiler_flags_enable_rtti = True,
10    compiler_flags_pedantic = True,
11    labels = [
12        "pfh:ReactNative_CommonInfrastructurePlaceholder",
13    ],
14    platforms = (ANDROID, APPLE, CXX),
15    tests = [":tests"],
16    visibility = ["PUBLIC"],
17    deps = [
18    ],
19    exported_deps = [
20        react_native_xplat_target("butter:butter"),
21        react_native_xplat_target("callinvoker:callinvoker"),
22        react_native_xplat_shared_library_target("jsi:jsi"),
23    ],
24)
25
26rn_xplat_cxx_library(
27    name = "testlib",
28    header_namespace = "react/bridging",
29    exported_headers = glob(["tests/*.h"]),
30    compiler_flags_pedantic = True,
31    platforms = (ANDROID, APPLE, CXX),
32    visibility = ["PUBLIC"],
33    exported_deps = [
34        ":bridging",
35        "//xplat/third-party/gmock:gtest",
36    ],
37)
38
39fb_xplat_cxx_test(
40    name = "tests",
41    srcs = glob(["tests/*.cpp"]),
42    headers = glob(["tests/*.h"]),
43    apple_sdks = (IOS, MACOSX),
44    compiler_flags = [
45        "-fexceptions",
46        "-frtti",
47        "-std=c++17",
48        "-Wall",
49    ],
50    contacts = ["[email protected]"],
51    platforms = (ANDROID, APPLE, CXX),
52    deps = [
53        ":bridging",
54        "//xplat/hermes/API:HermesAPI",
55        "//xplat/third-party/gmock:gtest",
56    ],
57)
58