1load("//tools/build_defs/oss:rn_defs.bzl", "APPLE", "IOS", "MACOSX", "react_native_xplat_dep", "rn_xplat_cxx_library")
2
3rn_xplat_cxx_library(
4    name = "jsi",
5    srcs = [
6        "jsi/jsi.cpp",
7    ],
8    header_namespace = "",
9    exported_headers = [
10        "jsi/instrumentation.h",
11        "jsi/jsi.h",
12        "jsi/jsi-inl.h",
13        "jsi/jsilib.h",
14    ],
15    compiler_flags = [
16        "-O3",
17        "-Wextra",
18        "-Wcast-qual",
19        "-Wdelete-non-virtual-dtor",
20        "-Wwrite-strings",
21    ],
22    cxx_compiler_flags = [
23        "-Wglobal-constructors",
24        "-Wmissing-prototypes",
25    ],
26    fbobjc_compiler_flags = [
27        "-Wglobal-constructors",
28        "-Wmissing-prototypes",
29    ],
30    labels = [
31        "pfh:ReactNative_CommonInfrastructurePlaceholder",
32        "supermodule:xplat/default/public.react_native.infra",
33    ],
34    visibility = ["PUBLIC"],
35)
36
37rn_xplat_cxx_library(
38    name = "JSIDynamic",
39    srcs = [
40        "jsi/JSIDynamic.cpp",
41    ],
42    header_namespace = "",
43    exported_headers = [
44        "jsi/JSIDynamic.h",
45    ],
46    fbobjc_force_static = True,
47    labels = [
48        "pfh:ReactNative_CommonInfrastructurePlaceholder",
49        "supermodule:xplat/default/public.react_native.infra",
50    ],
51    visibility = [
52        "PUBLIC",
53    ],
54    xcode_public_headers_symlinks = True,
55    deps = [
56        "//xplat/folly:molly",
57        react_native_xplat_dep("jsi:jsi"),
58    ],
59)
60
61rn_xplat_cxx_library(
62    name = "JSCRuntime",
63    srcs = [
64        "JSCRuntime.cpp",
65    ],
66    header_namespace = "jsi",
67    exported_headers = [
68        "JSCRuntime.h",
69    ],
70    apple_sdks = (IOS, MACOSX),
71    fbobjc_compiler_flags = [
72        "-Os",
73    ],
74    fbobjc_frameworks = [
75        "$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
76    ],
77    labels = [
78        "pfh:ReactNative_CommonInfrastructurePlaceholder",
79        "supermodule:xplat/default/public.react_native.infra",
80    ],
81    platforms = APPLE,
82    visibility = ["PUBLIC"],
83    xplat_mangled_args = {
84        "soname": "libjscjsi.$(ext)",
85    },
86    exported_deps = [
87        react_native_xplat_dep("jsi:jsi"),
88    ],
89)
90