BUCK
4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
load("@xplat//configurations/buck/apple:flag_defs.bzl", "DEBUG_PREPROCESSOR_FLAGS")
load("//ReactNative:DEFS.bzl", "IS_OSS_BUILD", "rn_xplat_cxx_library", "ANDROID_INSPECTOR_FLAGS", "APPLE_INSPECTOR_FLAGS", "ANDROID_JSC_DEPS", "APPLE_JSC_DEPS", "react_native_xplat_target")
CXX_LIBRARY_COMPILER_FLAGS = [
"-std=c++14",
"-Wall",
]
APPLE_COMPILER_FLAGS = []
if not IS_OSS_BUILD:
load("@xplat//configurations/buck/apple:flag_defs.bzl", "STATIC_LIBRARY_IOS_FLAGS", "flags")
APPLE_COMPILER_FLAGS = flags.get_flag_value(STATIC_LIBRARY_IOS_FLAGS, 'compiler_flags')
rn_xplat_cxx_library(
name = "module",
header_namespace = "",
exported_headers = subdir_glob(
[
("", "CxxModule.h"),
("", "JsArgumentHelpers.h"),
("", "JsArgumentHelpers-inl.h"),
],
prefix = "cxxreact",
),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
force_static = True,
visibility = [
"PUBLIC",
],
deps = [
"xplat//folly:molly",
],
)
rn_xplat_cxx_library(
name = "jsbigstring",
srcs = [
"JSBigString.cpp",
],
header_namespace = "",
exported_headers = subdir_glob(
[("", "JSBigString.h")],
prefix = "cxxreact",
),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
force_static = True,
visibility = [
"PUBLIC",
],
deps = [
"xplat//folly:memory",
"xplat//folly:molly",
"xplat//folly:scope_guard",
],
)
rn_xplat_cxx_library(
name = "samplemodule",
srcs = ["SampleCxxModule.cpp"],
header_namespace = "",
exported_headers = ["SampleCxxModule.h"],
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fno-omit-frame-pointer",
"-fexceptions",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
soname = "libxplat_react_module_samplemodule.$(ext)",
visibility = [
"PUBLIC",
],
deps = [
"xplat//folly:memory",
"xplat//folly:molly",
"xplat//third-party/glog:glog",
":module",
],
)
CXXREACT_PUBLIC_HEADERS = [
"CxxNativeModule.h",
"Instance.h",
"JSBundleType.h",
"JSExecutor.h",
"JSCExecutor.h",
"JSCNativeModules.h",
"JSIndexedRAMBundle.h",
"JSModulesUnbundle.h",
"MessageQueueThread.h",
"MethodCall.h",
"ModuleRegistry.h",
"NativeModule.h",
"NativeToJsBridge.h",
"Platform.h",
"RAMBundleRegistry.h",
"RecoverableError.h",
"SharedProxyCxxModule.h",
"SystraceSection.h",
]
rn_xplat_cxx_library(
name = "bridge",
srcs = glob(
["*.cpp"],
excludes = [
"JSBigString.cpp",
"SampleCxxModule.cpp",
],
),
headers = glob(
["*.h"],
excludes = CXXREACT_PUBLIC_HEADERS,
),
header_namespace = "",
exported_headers = dict([
(
"cxxreact/%s" % header,
header,
)
for header in CXXREACT_PUBLIC_HEADERS
]),
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
"-fexceptions",
"-frtti",
],
fbandroid_deps = ANDROID_JSC_DEPS,
fbandroid_preprocessor_flags = ANDROID_INSPECTOR_FLAGS + [
"-DWITH_JSC_EXTRA_TRACING=1",
"-DWITH_JSC_MEMORY_PRESSURE=1",
"-DWITH_FB_MEMORY_PROFILING=1",
],
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_deps = APPLE_JSC_DEPS,
fbobjc_frameworks = [
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
],
fbobjc_preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS + APPLE_INSPECTOR_FLAGS,
force_static = True,
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [
react_native_xplat_target("cxxreact/tests:tests"),
],
visibility = ["PUBLIC"],
deps = [
"xplat//fbsystrace:fbsystrace",
"xplat//folly:headers_only",
"xplat//folly:memory",
"xplat//folly:molly",
":jsbigstring",
":module",
react_native_xplat_target("jschelpers:jschelpers"),
react_native_xplat_target("jsinspector:jsinspector"),
react_native_xplat_target("microprofiler:microprofiler"),
"xplat//folly:optional",
"xplat//third-party/glog:glog",
react_native_xplat_target("jschelpers:jscinternalhelpers"),
react_native_xplat_target("privatedata:privatedata"),
],
)