mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Build Hermes from Source (#33396)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33396 This commit fully unplugs the `ReactAndroid` from using hermes from the NPM package and plugs the usage of Hermes via the `packages/hermes-engine` Gradle build. I've used prefab to share the .so between the two builds, so we don't need any extra machinery to make this possible. Moreover, I've added a `buildHermesFromSource` property, which defaults to false when RN is imported, but is set to true when RN is opened for local development. This should allow us to distribute the `react-native` NPM package and users could potentially toggle which source to use (but see below). Changelog: [Android] [Changed] - Build Hermes from Source Reviewed By: hramos Differential Revision: D34389875 fbshipit-source-id: 107cbe3686daf7607a1f0f75202f24cd80ce64bb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d34a75e9e5
commit
a3d9892ed9
@@ -7,14 +7,13 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
REACT_NATIVE := $(LOCAL_PATH)/../../../../../../../..
|
||||
|
||||
include $(REACT_NATIVE)/ReactCommon/common.mk
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := jsijniprofiler
|
||||
|
||||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi
|
||||
|
||||
LOCAL_CPP_FEATURES := exceptions
|
||||
|
||||
@@ -29,5 +28,3 @@ LOCAL_SHARED_LIBRARIES := \
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
@@ -6,47 +6,47 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
REACT_NATIVE := $(LOCAL_PATH)/../../../../../../../..
|
||||
|
||||
include $(REACT_NATIVE)/ReactCommon/common.mk
|
||||
include $(CLEAR_VARS)
|
||||
ifeq ($(APP_OPTIM),debug)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := hermes-executor-release
|
||||
LOCAL_MODULE := hermes-executor-debug
|
||||
LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1
|
||||
|
||||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi
|
||||
|
||||
LOCAL_CPP_FEATURES := exceptions
|
||||
LOCAL_CPP_FEATURES := exceptions
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-release
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libfb \
|
||||
libfbjni \
|
||||
libfolly_json \
|
||||
libhermes \
|
||||
libjsi \
|
||||
libreactnativejni
|
||||
LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-debug
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libfb \
|
||||
libfbjni \
|
||||
libfolly_json \
|
||||
libhermes \
|
||||
libjsi \
|
||||
libreactnativejni
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
else
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := hermes-executor-release
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||
|
||||
LOCAL_MODULE := hermes-executor-debug
|
||||
LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi
|
||||
|
||||
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
||||
LOCAL_CPP_FEATURES := exceptions
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
||||
LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-release
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libfb \
|
||||
libfbjni \
|
||||
libfolly_json \
|
||||
libhermes \
|
||||
libjsi \
|
||||
libreactnativejni
|
||||
|
||||
LOCAL_CPP_FEATURES := exceptions
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-debug
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libfb \
|
||||
libfbjni \
|
||||
libfolly_json \
|
||||
libhermes \
|
||||
libjsi \
|
||||
libreactnativejni
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user