forked from facebook/react-native
/
Android.mk
151 lines (116 loc) · 5.15 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
##########################
### React Native Utils ###
##########################
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Include . in the header search path for all source files in this module.
LOCAL_C_INCLUDES := $(LOCAL_PATH)
# Include ./../../ in the header search path for modules that depend on
# reactnativejni. This will allow external modules to require this module's
# headers using #include <react/jni/<header>.h>, assuming:
# . == jni
# ./../ == react
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../..
LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture
LOCAL_LDLIBS += -landroid
# The dynamic libraries (.so files) that this module depends on.
LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga libreact_render_runtimescheduler
# The static libraries (.a files) that this module depends on.
LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder libruntimeexecutor
# Name of this module.
#
# Other modules can depend on this one by adding libreactnativejni to their
# LOCAL_SHARED_LIBRARIES variable.
LOCAL_MODULE := reactnativeutilsjni
# Compile all local c++ files.
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
ifeq ($(APP_OPTIM),debug)
# Keep symbols by overriding the strip command invoked by ndk-build.
# Note that this will apply to all shared libraries,
# i.e. shared libraries will NOT be stripped
# even though we override it in this Android.mk
cmd-strip :=
endif
# Build the files in this directory as a shared library
include $(BUILD_SHARED_LIBRARY)
######################
### reactnativejni ###
######################
include $(CLEAR_VARS)
# Include . in the header search path for all source files in this module.
LOCAL_C_INCLUDES := $(LOCAL_PATH)
# Include ./../../ in the header search path for modules that depend on
# reactnativejni. This will allow external modules to require this module's
# headers using #include <react/jni/<header>.h>, assuming:
# . == jni
# ./../ == react
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../..
LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture
LOCAL_LDLIBS += -landroid
# The dynamic libraries (.so files) that this module depends on.
LOCAL_SHARED_LIBRARIES := libreactnativeutilsjni libfolly_json libfb libfbjni libglog_init libyoga logger libreact_render_runtimescheduler
# The static libraries (.a files) that this module depends on.
LOCAL_STATIC_LIBRARIES := libreactnative libruntimeexecutor libcallinvokerholder
# Name of this module.
#
# Other modules can depend on this one by adding libreactnativejni to their
# LOCAL_SHARED_LIBRARIES variable.
LOCAL_MODULE := reactnativejni
# Compile all local c++ files.
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
ifeq ($(APP_OPTIM),debug)
# Keep symbols by overriding the strip command invoked by ndk-build.
# Note that this will apply to all shared libraries,
# i.e. shared libraries will NOT be stripped
# even though we override it in this Android.mk
cmd-strip :=
endif
# Build the files in this directory as a shared library
include $(BUILD_SHARED_LIBRARY)
# Compile the c++ dependencies required for ReactAndroid
#
# How does the import-module function work?
# For each $(call import-module,<module-dir>), you search the directories in
# NDK_MODULE_PATH. (This variable is defined in Application.mk). If you find a
# <module-dir>/Android.mk you in a directory <dir>, you run:
# include <dir>/<module-dir>/Android.mk
#
# What does it mean to include an Android.mk file?
# Whenever you encounter an include <dir>/<module-dir>/Android.mk, you
# tell andorid-ndk to compile the module in <dir>/<module-dir> according
# to the specification inside <dir>/<module-dir>/Android.mk.
$(call import-module,better)
$(call import-module,folly)
$(call import-module,fb)
$(call import-module,fbjni)
$(call import-module,jsc)
$(call import-module,fbgloginit)
$(call import-module,yogajni)
$(call import-module,cxxreact)
$(call import-module,jsi)
$(call import-module,jsiexecutor)
$(call import-module,logger)
$(call import-module,callinvoker)
$(call import-module,reactperflogger)
$(call import-module,hermes)
$(call import-module,runtimeexecutor)
$(call import-module,react/renderer/runtimescheduler)
$(call import-module,react/nativemodule/core)
include $(REACT_SRC_DIR)/reactperflogger/jni/Android.mk
# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
# Note: Update this only when ready to minimize breaking changes.
include $(REACT_SRC_DIR)/turbomodule/core/jni/Android.mk
include $(REACT_SRC_DIR)/fabric/jni/Android.mk
include $(REACT_SRC_DIR)/common/mapbuffer/jni/Android.mk
# TODO(ramanpreet):
# Why doesn't this import-module call generate a jscexecutor.so file?
# $(call import-module,jscexecutor)
include $(REACT_SRC_DIR)/jscexecutor/Android.mk
include $(REACT_SRC_DIR)/../hermes/reactexecutor/Android.mk
include $(REACT_SRC_DIR)/../hermes/instrumentation/Android.mk
include $(REACT_SRC_DIR)/modules/blob/jni/Android.mk
include $(REACT_GENERATED_SRC_DIR)/codegen/jni/Android.mk