TurboModule Android: compile TurboModule C++ Core into ReactAndroid

Summary:
This is to prepare for enabling TurboModule on Android. This commit compiles in all the core files (C++) into the ReactAndroid NDK build step. This doesn't yet enable TurboModule by default, just compiling in the infra, just like for iOS.

New shared libs:
* libreact_nativemodule_core.so: The TurboModule Android core
* libreact_nativemodule_manager.so: The TurboModule manager/delegate

To be compatible with `<ReactCommon/` .h include prefix, the files had to move to local `ReactCommon` subdirs.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23805717

fbshipit-source-id: b41c392a592dd095ae003f7b2a689f4add2c37a9
This commit is contained in:
Kevin Gozali
2020-09-20 14:21:52 -07:00
committed by Facebook GitHub Bot
parent 412fc7d324
commit 5be44456f2
20 changed files with 76 additions and 11 deletions
@@ -5,6 +5,10 @@
LOCAL_PATH := $(call my-dir)
#########################
### callinvokerholder ###
#########################
include $(CLEAR_VARS)
# Header search path for all source files in this module.
@@ -15,10 +19,10 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall
LOCAL_STATIC_LIBRARIES = libcallinvoker libreactperfloggerjni
LOCAL_SHARED_LIBRARIES = libfb libfbjni
LOCAL_STATIC_LIBRARIES = libcallinvoker libreactperfloggerjni
# Name of this module.
LOCAL_MODULE := callinvokerholder
@@ -27,3 +31,30 @@ LOCAL_SRC_FILES := $(LOCAL_PATH)/ReactCommon/CallInvokerHolder.cpp
# Build the files in this directory as a shared library
include $(BUILD_STATIC_LIBRARY)
##################################
### react_nativemodule_manager ###
##################################
include $(CLEAR_VARS)
# Name of this module.
LOCAL_MODULE := react_nativemodule_manager
# Header search path for all source files in this module.
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ReactCommon
# Header search path for modules that depend on this module
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall
LOCAL_SHARED_LIBRARIES = libfb libfbjni libreact_nativemodule_core
LOCAL_STATIC_LIBRARIES = libcallinvokerholder libreactperfloggerjni
# Compile all local c++ files
LOCAL_SRC_FILES := $(LOCAL_PATH)/ReactCommon/TurboModuleManager.cpp $(LOCAL_PATH)/ReactCommon/OnLoad.cpp
# Build the files in this directory as a shared library
include $(BUILD_SHARED_LIBRARY)