Skip to content

Commit

Permalink
fix: rollback gradle config android
Browse files Browse the repository at this point in the history
  • Loading branch information
jerson committed Jun 20, 2022
1 parent d2a9fba commit 1f3531e
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 340 deletions.
53 changes: 13 additions & 40 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,36 @@
cmake_minimum_required(VERSION 3.9.0)

set (PACKAGE_NAME "react-native-fast-rsa")
set (CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_STANDARD 14)
set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)

add_library(rsa_bridge SHARED IMPORTED)


file(TO_CMAKE_PATH ${NODE_MODULES_DIR} NODE_MODULES_DIR)


set_target_properties(rsa_bridge
PROPERTIES
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/librsa_bridge.so
)

include_directories(
../cpp
"${NODE_MODULES_DIR}/react-native/React"
"${NODE_MODULES_DIR}/react-native/React/Base"
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
)
)

add_library(fast-rsa
SHARED
SHARED
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp"
../cpp/react-native-fast-rsa.cpp
../cpp/react-native-fast-rsa.h
fast-rsa-adapter.cpp
)

set_target_properties(
fast-rsa PROPERTIES
CXX_STANDARD 14
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON
)

file (GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}")

find_library(
log-lib
log
)
find_library(
JSI_LIB
jsi
PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH
)
find_library(
REACT_NATIVE_JNI_LIB
reactnativejni
PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH
include_directories(
fast-rsa
PRIVATE
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
../cpp
)

target_link_libraries(
fast-rsa
target_link_libraries(fast-rsa
rsa_bridge
${log-lib}
${JSI_LIB}
${REACT_NATIVE_JNI_LIB}
android
)
log)
Loading

0 comments on commit 1f3531e

Please sign in to comment.