-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mmmoussa/rn-0.71.0
- Loading branch information
Showing
2 changed files
with
38 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,36 @@ | ||
project(reactnativerandomvaluesjsihelper) | ||
cmake_minimum_required(VERSION 3.9.0) | ||
|
||
set (PACKAGE_NAME "react-native-random-values-jsi-helper") | ||
set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
include_directories( | ||
"../cpp" | ||
"${NODE_MODULES_DIR}/react-native/React" | ||
"${NODE_MODULES_DIR}/react-native/React/Base" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi" | ||
) | ||
|
||
if(${REACT_NATIVE_VERSION} LESS 66) | ||
set ( | ||
INCLUDE_JSI_CPP | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp" | ||
) | ||
endif() | ||
|
||
add_library(reactnativerandomvaluesjsihelper | ||
SHARED | ||
cpp-adapter.cpp | ||
"../cpp/TypedArray.cpp" | ||
${INCLUDE_JSI_CPP} | ||
) | ||
set_target_properties( | ||
reactnativerandomvaluesjsihelper PROPERTIES | ||
CXX_STANDARD 14 | ||
CXX_STANDARD 17 | ||
CXX_EXTENSIONS OFF | ||
POSITION_INDEPENDENT_CODE ON | ||
) | ||
|
||
file (GLOB LIBRN_DIR "${PREBUILT_DIR}/${ANDROID_ABI}") | ||
|
||
find_package(ReactAndroid REQUIRED CONFIG) | ||
find_library( | ||
log-lib | ||
log | ||
) | ||
find_library( | ||
REACT_NATIVE_JNI_LIB | ||
reactnativejni | ||
PATHS ${LIBRN_DIR} | ||
NO_CMAKE_FIND_ROOT_PATH | ||
) | ||
if(${REACT_NATIVE_VERSION} LESS 66) | ||
# JSI lib didn't exist on RN 0.65 and before. Simply omit it. | ||
set (JSI_LIB "") | ||
else() | ||
# RN 0.66 distributes libjsi.so, can be used instead of compiling jsi.cpp manually. | ||
find_library( | ||
JSI_LIB | ||
jsi | ||
PATHS ${LIBRN_DIR} | ||
NO_CMAKE_FIND_ROOT_PATH | ||
) | ||
endif() | ||
|
||
target_link_libraries( | ||
reactnativerandomvaluesjsihelper | ||
${log-lib} | ||
${JSI_LIB} | ||
${REACT_NATIVE_JNI_LIB} | ||
ReactAndroid::jsi | ||
android | ||
) |
Oops, something went wrong.