2017-05-11 11:46:44 +00:00
|
|
|
include_defs("//ReactCommon/DEFS")
|
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
|
|
|
|
2016-06-12 03:47:59 +00:00
|
|
|
if THIS_IS_FBOBJC:
|
2016-08-29 20:20:14 +00:00
|
|
|
inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS
|
2017-05-11 11:46:44 +00:00
|
|
|
CXX_LIBRARY_COMPILER_FLAGS += inherited_buck_flags.get_flag_value('compiler_flags')
|
2017-05-03 04:29:04 +00:00
|
|
|
|
2017-05-12 09:36:06 +00:00
|
|
|
rn_xplat_cxx_library(
|
2017-02-25 05:40:45 +00:00
|
|
|
name = "module",
|
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
|
2017-05-17 21:20:35 +00:00
|
|
|
exported_headers = subdir_glob(
|
|
|
|
[
|
|
|
|
("", "CxxModule.h"),
|
|
|
|
("", "JsArgumentHelpers.h"),
|
|
|
|
("", "JsArgumentHelpers-inl.h"),
|
|
|
|
],
|
|
|
|
prefix = "cxxreact",
|
|
|
|
),
|
2017-02-25 05:40:45 +00:00
|
|
|
force_static = True,
|
2017-05-17 21:20:35 +00:00
|
|
|
header_namespace = "",
|
2017-02-25 05:40:45 +00:00
|
|
|
visibility = [
|
|
|
|
"PUBLIC",
|
|
|
|
],
|
|
|
|
xcode_public_headers_symlinks = True,
|
|
|
|
deps = [
|
|
|
|
"//xplat/folly:molly",
|
|
|
|
],
|
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",
|
|
|
|
],
|
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
|
|
|
"-fexceptions",
|
|
|
|
"-frtti",
|
|
|
|
],
|
2017-05-17 21:20:35 +00:00
|
|
|
exported_headers = subdir_glob(
|
|
|
|
[("", "JSBigString.h")],
|
|
|
|
prefix = "cxxreact",
|
|
|
|
),
|
2017-05-11 15:52:04 +00:00
|
|
|
force_static = True,
|
2017-05-17 21:20:35 +00:00
|
|
|
header_namespace = "",
|
2017-05-11 15:52:04 +00:00
|
|
|
visibility = [
|
|
|
|
"PUBLIC",
|
|
|
|
],
|
|
|
|
xcode_public_headers_symlinks = True,
|
|
|
|
deps = [
|
|
|
|
"//xplat/folly:molly",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
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"],
|
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
|
|
|
"-fno-omit-frame-pointer",
|
|
|
|
"-fexceptions",
|
|
|
|
],
|
|
|
|
exported_headers = ["SampleCxxModule.h"],
|
|
|
|
header_namespace = "",
|
|
|
|
soname = "libxplat_react_module_samplemodule.so",
|
|
|
|
visibility = [
|
|
|
|
"PUBLIC",
|
|
|
|
],
|
|
|
|
xcode_public_headers_symlinks = True,
|
|
|
|
deps = [
|
|
|
|
":module",
|
|
|
|
"//xplat/folly:molly",
|
|
|
|
],
|
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",
|
|
|
|
"Executor.h",
|
|
|
|
"Instance.h",
|
2017-04-04 17:29:05 +00:00
|
|
|
"JSBundleType.h",
|
2017-02-25 05:40:45 +00:00
|
|
|
"JSCExecutor.h",
|
|
|
|
"JSCNativeModules.h",
|
|
|
|
"JSIndexedRAMBundle.h",
|
|
|
|
"JSModulesUnbundle.h",
|
|
|
|
"MessageQueueThread.h",
|
|
|
|
"MethodCall.h",
|
|
|
|
"ModuleRegistry.h",
|
|
|
|
"NativeModule.h",
|
|
|
|
"NativeToJsBridge.h",
|
|
|
|
"Platform.h",
|
|
|
|
"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"],
|
2017-05-11 15:52:04 +00:00
|
|
|
excludes = [
|
|
|
|
"JSBigString.cpp",
|
|
|
|
"SampleCxxModule.cpp",
|
|
|
|
],
|
2017-02-25 05:40:45 +00:00
|
|
|
),
|
2017-05-11 11:46:44 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
2017-02-25 05:40:45 +00:00
|
|
|
"-fexceptions",
|
|
|
|
"-frtti",
|
2017-05-11 11:46:44 +00:00
|
|
|
],
|
2017-05-17 21:20:35 +00:00
|
|
|
exported_headers = dict([
|
|
|
|
(
|
|
|
|
"cxxreact/%s" % header,
|
|
|
|
header,
|
|
|
|
)
|
|
|
|
for header in CXXREACT_PUBLIC_HEADERS
|
|
|
|
]),
|
2017-05-11 11:46:44 +00:00
|
|
|
fbandroid_preprocessor_flags = [
|
|
|
|
"-DWITH_JSC_EXTRA_TRACING=1",
|
|
|
|
"-DWITH_JSC_MEMORY_PRESSURE=1",
|
|
|
|
"-DWITH_REACT_INTERNAL_SETTINGS=1",
|
|
|
|
"-DWITH_FB_MEMORY_PROFILING=1",
|
|
|
|
],
|
|
|
|
fbandroid_visibility = [
|
|
|
|
# TL;DR: If you depend on this target directly, you're gonna have a
|
|
|
|
# Bad Time(TM).
|
|
|
|
#
|
|
|
|
# `facebook::react::JSCExecutor::initOnJSVMThread` (in `:bridge`) does
|
|
|
|
# some platform-dependant setup. Exactly what setup to do is
|
|
|
|
# determined by some static functors, defined in `Platform.h`, which
|
|
|
|
# are initially `nullptr`. On Android, these functors are properly
|
|
|
|
# assigned as part of `xreact`'s `JNI_OnLoad`. By depending directly
|
|
|
|
# on the bridge, we can mess up the SO initialisation order, causing
|
|
|
|
# `initOnJSVMThread` to be called before the platform-specific hooks
|
|
|
|
# have been properly initialised. Bad Times(TM).
|
|
|
|
# -- @ashokmenon (2017/01/03)
|
|
|
|
react_native_target("jni/xreact/jni:jni"),
|
|
|
|
react_native_xplat_target("cxxreact/..."),
|
|
|
|
],
|
|
|
|
fbobjc_frameworks = [
|
|
|
|
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
|
|
|
|
],
|
|
|
|
fbobjc_inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,
|
|
|
|
fbobjc_preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS,
|
|
|
|
fbobjc_visibility = ["PUBLIC"],
|
2017-02-25 05:40:45 +00:00
|
|
|
force_static = True,
|
2017-05-17 21:20:35 +00:00
|
|
|
header_namespace = "",
|
2017-02-25 05:40:45 +00:00
|
|
|
headers = glob(
|
|
|
|
["*.h"],
|
|
|
|
excludes = CXXREACT_PUBLIC_HEADERS,
|
|
|
|
),
|
|
|
|
preprocessor_flags = [
|
|
|
|
"-DLOG_TAG=\"ReactNative\"",
|
|
|
|
"-DWITH_FBSYSTRACE=1",
|
2017-05-11 11:46:44 +00:00
|
|
|
] + INSPECTOR_FLAGS,
|
|
|
|
tests = [
|
|
|
|
react_native_xplat_target("cxxreact/tests:tests"),
|
2017-02-25 05:40:45 +00:00
|
|
|
],
|
|
|
|
xcode_public_headers_symlinks = True,
|
|
|
|
deps = [
|
|
|
|
":module",
|
2017-05-11 15:52:04 +00:00
|
|
|
":jsbigstring",
|
2017-02-25 05:40:45 +00:00
|
|
|
"//xplat/fbsystrace:fbsystrace",
|
2017-05-11 11:46:44 +00:00
|
|
|
"//xplat/folly:molly",
|
2017-02-25 05:40:45 +00:00
|
|
|
react_native_xplat_target("jschelpers:jschelpers"),
|
|
|
|
react_native_xplat_target("microprofiler:microprofiler"),
|
2017-05-11 11:46:44 +00:00
|
|
|
] + JSC_DEPS,
|
2016-05-04 02:29:58 +00:00
|
|
|
)
|