2016-06-12 03:47:59 +00:00
|
|
|
CXX_LIBRARY_COMPILER_FLAGS = []
|
|
|
|
REACT_LIBRARY_EXTRA_COMPILER_FLAGS = []
|
|
|
|
if THIS_IS_FBOBJC:
|
2016-08-29 20:20:14 +00:00
|
|
|
inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS
|
2016-08-29 17:09:11 +00:00
|
|
|
CXX_LIBRARY_COMPILER_FLAGS = inherited_buck_flags.get_flag_value('compiler_flags')
|
2016-06-22 20:42:55 +00:00
|
|
|
REACT_LIBRARY_EXTRA_COMPILER_FLAGS = ['-Wno-shadow', '-Wno-missing-prototypes', '-Wno-global-constructors']
|
2016-06-12 03:47:59 +00:00
|
|
|
|
2016-05-04 02:29:58 +00:00
|
|
|
def kwargs_add(base_kwargs, **new_kwargs):
|
|
|
|
ret_kwargs = dict(base_kwargs)
|
|
|
|
for name, add_value in new_kwargs.iteritems():
|
|
|
|
if name in ret_kwargs:
|
|
|
|
# Don't use +=, it will modify base_kwargs
|
|
|
|
ret_kwargs[name] = ret_kwargs[name] + add_value
|
|
|
|
else:
|
|
|
|
ret_kwargs[name] = add_value
|
|
|
|
return ret_kwargs
|
|
|
|
|
|
|
|
if THIS_IS_FBANDROID:
|
|
|
|
include_defs('//ReactAndroid/DEFS')
|
|
|
|
|
|
|
|
def react_library(**kwargs):
|
|
|
|
kwargs = kwargs_add(
|
|
|
|
kwargs,
|
|
|
|
# We depend on JSC, support the same platforms
|
|
|
|
supported_platforms_regex = '^android-(armv7|x86)$',
|
|
|
|
compiler_flags = [
|
|
|
|
'-Wno-pessimizing-move',
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
'//xplat/folly:molly',
|
|
|
|
])
|
|
|
|
|
|
|
|
cxx_library(
|
|
|
|
name = 'bridge',
|
|
|
|
**kwargs_add(
|
|
|
|
kwargs,
|
|
|
|
preprocessor_flags = [
|
|
|
|
'-DWITH_JSC_EXTRA_TRACING=1',
|
|
|
|
'-DWITH_JSC_MEMORY_PRESSURE=1',
|
|
|
|
'-DWITH_REACT_INTERNAL_SETTINGS=1',
|
|
|
|
'-DWITH_FB_MEMORY_PROFILING=1',
|
|
|
|
],
|
|
|
|
deps = JSC_DEPS
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
elif THIS_IS_FBOBJC:
|
|
|
|
def react_library(**kwargs):
|
|
|
|
ios_library(
|
|
|
|
name = 'bridge',
|
|
|
|
header_path_prefix = "cxxreact",
|
2016-08-29 20:20:14 +00:00
|
|
|
inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS,
|
2016-05-04 02:29:58 +00:00
|
|
|
frameworks = [
|
|
|
|
'$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework',
|
|
|
|
],
|
2016-09-19 11:43:09 +00:00
|
|
|
tests = [
|
|
|
|
react_native_xplat_target('cxxreact/tests:tests')
|
|
|
|
],
|
2016-05-04 02:29:58 +00:00
|
|
|
**kwargs_add(
|
|
|
|
kwargs,
|
2016-05-14 00:15:03 +00:00
|
|
|
preprocessor_flags = DEBUG_PREPROCESSOR_FLAGS,
|
2016-05-04 02:29:58 +00:00
|
|
|
deps = [
|
|
|
|
'//xplat/folly:molly',
|
|
|
|
]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2016-05-25 02:24:57 +00:00
|
|
|
cxx_library(
|
|
|
|
name = 'module',
|
|
|
|
force_static = True,
|
2016-06-12 03:47:59 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
|
2016-09-30 21:14:08 +00:00
|
|
|
xcode_public_headers_symlinks = True,
|
2016-05-25 02:24:57 +00:00
|
|
|
exported_headers = [
|
|
|
|
'CxxModule.h',
|
|
|
|
'JsArgumentHelpers.h',
|
|
|
|
'JsArgumentHelpers-inl.h',
|
|
|
|
],
|
2016-05-27 23:02:50 +00:00
|
|
|
header_namespace = 'cxxreact',
|
2016-05-25 02:24:57 +00:00
|
|
|
deps = [
|
|
|
|
'//xplat/folly:molly',
|
|
|
|
],
|
|
|
|
visibility = [
|
|
|
|
'PUBLIC',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cxx_library(
|
|
|
|
name = 'samplemodule',
|
|
|
|
soname = 'libxplat_react_module_samplemodule.so',
|
|
|
|
srcs = ['SampleCxxModule.cpp'],
|
2016-09-30 21:14:08 +00:00
|
|
|
xcode_public_headers_symlinks = True,
|
2016-05-25 02:24:57 +00:00
|
|
|
exported_headers = ['SampleCxxModule.h'],
|
|
|
|
header_namespace = '',
|
2016-06-12 03:47:59 +00:00
|
|
|
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [
|
2016-05-25 02:24:57 +00:00
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
'-Wall',
|
|
|
|
'-Werror',
|
2016-09-12 23:34:15 +00:00
|
|
|
'-std=c++1y',
|
2016-05-25 02:24:57 +00:00
|
|
|
'-fexceptions',
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
':module',
|
|
|
|
'//xplat/folly:molly',
|
|
|
|
],
|
|
|
|
visibility = [
|
|
|
|
'PUBLIC',
|
|
|
|
],
|
|
|
|
)
|
2016-05-04 02:29:58 +00:00
|
|
|
|
2016-09-30 16:27:50 +00:00
|
|
|
CXXREACT_PUBLIC_HEADERS = [
|
|
|
|
'CxxMessageQueue.h',
|
|
|
|
'CxxNativeModule.h',
|
|
|
|
'Executor.h',
|
|
|
|
'ExecutorToken.h',
|
|
|
|
'ExecutorTokenFactory.h',
|
|
|
|
'Instance.h',
|
|
|
|
'JSCExecutor.h',
|
|
|
|
'JSCHelpers.h',
|
|
|
|
'JSCWebWorker.h',
|
|
|
|
'JSModulesUnbundle.h',
|
|
|
|
'MessageQueueThread.h',
|
|
|
|
'MethodCall.h',
|
|
|
|
'ModuleRegistry.h',
|
|
|
|
'NativeModule.h',
|
|
|
|
'NativeToJsBridge.h',
|
|
|
|
'noncopyable.h',
|
|
|
|
'Platform.h',
|
|
|
|
'SystraceSection.h',
|
|
|
|
'Unicode.h',
|
|
|
|
'Value.h',
|
|
|
|
]
|
|
|
|
|
2016-05-04 02:29:58 +00:00
|
|
|
react_library(
|
2016-10-08 16:21:57 +00:00
|
|
|
soname = 'libreactnativefb.$(ext)',
|
2016-05-04 02:29:58 +00:00
|
|
|
header_namespace = 'cxxreact',
|
|
|
|
force_static = True,
|
2016-09-30 16:27:50 +00:00
|
|
|
srcs = glob(['*.cpp']),
|
|
|
|
headers = glob(['*.h'], excludes=CXXREACT_PUBLIC_HEADERS),
|
2016-09-30 21:14:08 +00:00
|
|
|
xcode_public_headers_symlinks = True,
|
2016-09-30 16:27:50 +00:00
|
|
|
exported_headers = CXXREACT_PUBLIC_HEADERS,
|
2016-05-04 02:29:58 +00:00
|
|
|
preprocessor_flags = [
|
|
|
|
'-DLOG_TAG="ReactNative"',
|
|
|
|
'-DWITH_FBSYSTRACE=1',
|
|
|
|
],
|
|
|
|
compiler_flags = [
|
|
|
|
'-Wall',
|
|
|
|
'-fexceptions',
|
|
|
|
'-fvisibility=hidden',
|
|
|
|
'-frtti',
|
2016-09-12 23:34:15 +00:00
|
|
|
'-std=c++1y',
|
2016-06-12 03:47:59 +00:00
|
|
|
] + REACT_LIBRARY_EXTRA_COMPILER_FLAGS,
|
2016-05-04 02:29:58 +00:00
|
|
|
deps = [
|
2016-08-03 22:58:45 +00:00
|
|
|
':module',
|
2016-05-04 02:29:58 +00:00
|
|
|
'//xplat/fbsystrace:fbsystrace',
|
2016-08-02 14:32:59 +00:00
|
|
|
react_native_xplat_target('microprofiler:microprofiler'),
|
2016-05-04 02:29:58 +00:00
|
|
|
],
|
|
|
|
visibility = [ 'PUBLIC' ],
|
|
|
|
)
|