2018-08-30 08:37:07 +00:00
|
|
|
load("@fbsource//tools/build_defs:glob_defs.bzl", "subdir_glob")
|
2018-10-18 07:47:05 +00:00
|
|
|
load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "APPLE", "get_android_inspector_flags", "get_apple_compiler_flags", "get_apple_inspector_flags", "get_debug_preprocessor_flags", "react_native_xplat_target", "rn_xplat_cxx_library")
|
2017-02-25 05:40:45 +00:00
|
|
|
|
2017-05-11 11:46:44 +00:00
|
|
|
CXX_LIBRARY_COMPILER_FLAGS = [
|
|
|
|
"-std=c++14",
|
|
|
|
"-Wall",
|
|
|
|
]
|
2017-02-25 05:40:45 +00:00
|
|
|
|
2017-05-12 09:36:06 +00:00
|
|
|
rn_xplat_cxx_library(
|
2017-02-25 05:40:45 +00:00
|
|
|
name = "module",
|
2017-06-23 23:49:55 +00:00
|
|
|
header_namespace = "",
|
2017-05-17 21:20:35 +00:00
|
|
|
exported_headers = subdir_glob(
|
|
|
|
[
|
|
|
|
("", "CxxModule.h"),
|
|
|
|
("", "JsArgumentHelpers.h"),
|
|
|
|
("", "JsArgumentHelpers-inl.h"),
|
|
|
|
],
|
|
|
|
prefix = "cxxreact",
|
|
|
|
),
|
2017-06-23 23:49:55 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
|
2018-06-24 21:34:00 +00:00
|
|
|
fbobjc_compiler_flags = get_apple_compiler_flags(),
|
2017-02-25 05:40:45 +00:00
|
|
|
force_static = True,
|
|
|
|
visibility = [
|
|
|
|
"PUBLIC",
|
|
|
|
],
|
|
|
|
deps = [
|
2017-08-31 23:58:15 +00:00
|
|
|
"xplat//folly:molly",
|
2017-02-25 05:40:45 +00:00
|
|
|
],
|
2016-05-25 02:24:57 +00:00
|
|
|
)
|
|
|
|
|
2017-05-12 09:36:06 +00:00
|
|
|
rn_xplat_cxx_library(
|
2017-05-11 15:52:04 +00:00
|
|
|
name = "jsbigstring",
|
|
|
|
srcs = [
|
|
|
|
"JSBigString.cpp",
|
|
|
|
],
|
2017-06-23 23:49:55 +00:00
|
|
|
header_namespace = "",
|
2017-05-17 21:20:35 +00:00
|
|
|
exported_headers = subdir_glob(
|
|
|
|
[("", "JSBigString.h")],
|
|
|
|
prefix = "cxxreact",
|
|
|
|
),
|
2017-06-23 23:49:55 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
|
|
|
"-fexceptions",
|
|
|
|
"-frtti",
|
|
|
|
],
|
2018-06-24 21:34:00 +00:00
|
|
|
fbobjc_compiler_flags = get_apple_compiler_flags(),
|
2017-05-11 15:52:04 +00:00
|
|
|
force_static = True,
|
|
|
|
visibility = [
|
|
|
|
"PUBLIC",
|
|
|
|
],
|
|
|
|
deps = [
|
2018-01-22 16:32:42 +00:00
|
|
|
"xplat//folly:memory",
|
2017-08-31 23:58:15 +00:00
|
|
|
"xplat//folly:molly",
|
2018-01-20 20:01:45 +00:00
|
|
|
"xplat//folly:scope_guard",
|
2017-05-11 15:52:04 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-05-12 09:36:06 +00:00
|
|
|
rn_xplat_cxx_library(
|
2017-02-25 05:40:45 +00:00
|
|
|
name = "samplemodule",
|
|
|
|
srcs = ["SampleCxxModule.cpp"],
|
2017-06-23 23:49:55 +00:00
|
|
|
header_namespace = "",
|
|
|
|
exported_headers = ["SampleCxxModule.h"],
|
2017-02-25 05:40:45 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
|
|
|
"-fno-omit-frame-pointer",
|
|
|
|
"-fexceptions",
|
|
|
|
],
|
2018-06-24 21:34:00 +00:00
|
|
|
fbobjc_compiler_flags = get_apple_compiler_flags(),
|
2017-08-10 16:53:40 +00:00
|
|
|
soname = "libxplat_react_module_samplemodule.$(ext)",
|
2017-02-25 05:40:45 +00:00
|
|
|
visibility = [
|
|
|
|
"PUBLIC",
|
|
|
|
],
|
|
|
|
deps = [
|
2018-01-22 16:32:42 +00:00
|
|
|
"xplat//folly:memory",
|
2017-08-31 23:58:15 +00:00
|
|
|
"xplat//folly:molly",
|
2018-01-20 20:01:45 +00:00
|
|
|
"xplat//third-party/glog:glog",
|
2017-09-05 21:59:14 +00:00
|
|
|
":module",
|
2017-02-25 05:40:45 +00:00
|
|
|
],
|
2016-05-25 02:24:57 +00:00
|
|
|
)
|
2016-05-04 02:29:58 +00:00
|
|
|
|
2016-09-30 16:27:50 +00:00
|
|
|
CXXREACT_PUBLIC_HEADERS = [
|
2017-02-25 05:40:45 +00:00
|
|
|
"CxxNativeModule.h",
|
|
|
|
"Instance.h",
|
2017-04-04 17:29:05 +00:00
|
|
|
"JSBundleType.h",
|
2018-05-03 15:38:01 +00:00
|
|
|
"JSDeltaBundleClient.h",
|
2018-10-18 07:47:05 +00:00
|
|
|
"JSExecutor.h",
|
2017-02-25 05:40:45 +00:00
|
|
|
"JSIndexedRAMBundle.h",
|
|
|
|
"JSModulesUnbundle.h",
|
|
|
|
"MessageQueueThread.h",
|
|
|
|
"MethodCall.h",
|
|
|
|
"ModuleRegistry.h",
|
|
|
|
"NativeModule.h",
|
|
|
|
"NativeToJsBridge.h",
|
2017-09-22 16:56:50 +00:00
|
|
|
"RAMBundleRegistry.h",
|
2018-05-10 05:01:53 +00:00
|
|
|
"ReactMarker.h",
|
2017-02-25 05:40:45 +00:00
|
|
|
"RecoverableError.h",
|
2017-04-04 17:29:05 +00:00
|
|
|
"SharedProxyCxxModule.h",
|
2017-02-25 05:40:45 +00:00
|
|
|
"SystraceSection.h",
|
2016-09-30 16:27:50 +00:00
|
|
|
]
|
|
|
|
|
2017-05-12 09:36:06 +00:00
|
|
|
rn_xplat_cxx_library(
|
2017-05-11 11:46:44 +00:00
|
|
|
name = "bridge",
|
2017-02-25 05:40:45 +00:00
|
|
|
srcs = glob(
|
|
|
|
["*.cpp"],
|
2018-06-24 01:23:21 +00:00
|
|
|
exclude = [
|
2017-05-11 15:52:04 +00:00
|
|
|
"JSBigString.cpp",
|
|
|
|
"SampleCxxModule.cpp",
|
|
|
|
],
|
2017-02-25 05:40:45 +00:00
|
|
|
),
|
2017-06-23 23:49:55 +00:00
|
|
|
headers = glob(
|
|
|
|
["*.h"],
|
2018-06-24 01:23:21 +00:00
|
|
|
exclude = CXXREACT_PUBLIC_HEADERS,
|
2017-06-23 23:49:55 +00:00
|
|
|
),
|
|
|
|
header_namespace = "",
|
2017-05-17 21:20:35 +00:00
|
|
|
exported_headers = dict([
|
|
|
|
(
|
|
|
|
"cxxreact/%s" % header,
|
|
|
|
header,
|
|
|
|
)
|
|
|
|
for header in CXXREACT_PUBLIC_HEADERS
|
|
|
|
]),
|
2017-06-23 23:49:55 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
|
|
|
"-fexceptions",
|
|
|
|
"-frtti",
|
|
|
|
],
|
2018-10-18 07:47:05 +00:00
|
|
|
fbandroid_preprocessor_flags = get_android_inspector_flags(),
|
2018-06-24 21:34:00 +00:00
|
|
|
fbobjc_compiler_flags = get_apple_compiler_flags(),
|
2018-05-10 05:02:01 +00:00
|
|
|
fbobjc_force_static = True,
|
2018-06-24 21:34:00 +00:00
|
|
|
fbobjc_preprocessor_flags = get_debug_preprocessor_flags() + get_apple_inspector_flags(),
|
2018-04-14 20:04:28 +00:00
|
|
|
macosx_tests_override = [],
|
2018-04-05 22:47:03 +00:00
|
|
|
platforms = (ANDROID, APPLE),
|
2017-02-25 05:40:45 +00:00
|
|
|
preprocessor_flags = [
|
|
|
|
"-DLOG_TAG=\"ReactNative\"",
|
|
|
|
"-DWITH_FBSYSTRACE=1",
|
2018-01-22 05:54:01 +00:00
|
|
|
],
|
2017-05-11 11:46:44 +00:00
|
|
|
tests = [
|
|
|
|
react_native_xplat_target("cxxreact/tests:tests"),
|
2017-02-25 05:40:45 +00:00
|
|
|
],
|
2017-08-30 18:48:05 +00:00
|
|
|
visibility = ["PUBLIC"],
|
2017-02-25 05:40:45 +00:00
|
|
|
deps = [
|
2017-09-07 16:02:13 +00:00
|
|
|
"xplat//fbsystrace:fbsystrace",
|
2018-01-20 20:01:45 +00:00
|
|
|
"xplat//folly:headers_only",
|
2018-01-22 16:32:42 +00:00
|
|
|
"xplat//folly:memory",
|
2017-08-31 23:58:15 +00:00
|
|
|
"xplat//folly:molly",
|
2018-01-22 05:54:01 +00:00
|
|
|
":jsbigstring",
|
|
|
|
":module",
|
2017-11-27 15:05:22 +00:00
|
|
|
react_native_xplat_target("jsinspector:jsinspector"),
|
2017-02-25 05:40:45 +00:00
|
|
|
react_native_xplat_target("microprofiler:microprofiler"),
|
2018-01-20 20:01:45 +00:00
|
|
|
"xplat//folly:optional",
|
|
|
|
"xplat//third-party/glog:glog",
|
2018-01-22 05:54:01 +00:00
|
|
|
],
|
2016-05-04 02:29:58 +00:00
|
|
|
)
|