-
Notifications
You must be signed in to change notification settings - Fork 37
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 #35 from ospfranco/async-callback-threads
- Loading branch information
Showing
52 changed files
with
7,279 additions
and
3,572 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source 'https://rubygems.org' | ||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby '2.7.4' | ||
gem 'cocoapods', '~> 1.11', '>= 1.11.2' |
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
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,49 +1,121 @@ | ||
cmake_minimum_required(VERSION 3.4.1) | ||
cmake_minimum_required(VERSION 3.9.0) | ||
|
||
set (CMAKE_VERBOSE_MAKEFILE ON) | ||
set (CMAKE_CXX_STANDARD 11) | ||
|
||
# Uncomment the following lines to compile the example project | ||
# include_directories( | ||
# ../cpp | ||
# ../node_modules/react-native/React | ||
# ../node_modules/react-native/React/Base | ||
# ../node_modules/react-native/ReactCommon/jsi | ||
# ) | ||
|
||
# add_library(sequel | ||
# SHARED | ||
|
||
# ../node_modules/react-native/ReactCommon/jsi/jsi/jsi.cpp | ||
# ../cpp/sequel.cpp | ||
# ../cpp/sequel.h | ||
# ../cpp/SequelResult.h | ||
# ../cpp/react-native-quick-sqlite.cpp | ||
# ../cpp/react-native-quick-sqlite.h | ||
# ../cpp/sqlite3.h | ||
# ../cpp/sqlite3.c | ||
# cpp-adapter.cpp | ||
# ) | ||
set (CMAKE_CXX_STANDARD 14) | ||
#set (CMAKE_CXX_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DON_ANDROID -DONANDROID -DFOR_HERMES=${FOR_HERMES}") | ||
|
||
set (PACKAGE_NAME "react-native-quick-sqlite") | ||
set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build) | ||
set (RN_SO_DIR ${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/first-party/react/jni) | ||
|
||
if(${REACT_NATIVE_VERSION} LESS 66) | ||
set ( | ||
INCLUDE_JSI_CPP | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp" | ||
) | ||
set ( | ||
INCLUDE_JSIDYNAMIC_CPP | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/JSIDynamic.cpp" | ||
) | ||
endif() | ||
|
||
file (GLOB LIBFBJNI_INCLUDE_DIR "${BUILD_DIR}/fbjni-*-headers.jar/") | ||
|
||
include_directories( | ||
../cpp | ||
../../react-native/React | ||
../../react-native/React/Base | ||
../../react-native/ReactCommon/jsi | ||
"${NODE_MODULES_DIR}/react-native/React" | ||
"${NODE_MODULES_DIR}/react-native/React/Base" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker" | ||
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi" | ||
"${NODE_MODULES_DIR}/hermes-engine/android/include/" | ||
${INCLUDE_JSI_CPP} # only on older RN versions | ||
${INCLUDE_JSIDYNAMIC_CPP} # only on older RN versions | ||
) | ||
|
||
add_library(sequel | ||
add_library( | ||
${PACKAGE_NAME} | ||
SHARED | ||
../../react-native/ReactCommon/jsi/jsi/jsi.cpp | ||
../cpp/sequel.cpp | ||
../cpp/sequel.h | ||
../cpp/SequelResult.h | ||
../cpp/react-native-quick-sqlite.cpp | ||
../cpp/react-native-quick-sqlite.h | ||
../cpp/sqliteBridge.cpp | ||
../cpp/sqliteBridge.h | ||
../cpp/installer.cpp | ||
../cpp/installer.h | ||
../cpp/sqlite3.h | ||
../cpp/sqlite3.c | ||
../cpp/JSIHelper.h | ||
../cpp/JSIHelper.cpp | ||
../cpp/ThreadPool.h | ||
../cpp/ThreadPool.cpp | ||
../cpp/sqlfileloader.h | ||
../cpp/sqlfileloader.cpp | ||
../cpp/sqlbatchexecutor.h | ||
../cpp/sqlbatchexecutor.cpp | ||
cpp-adapter.cpp | ||
) | ||
|
||
# find fbjni package | ||
file (GLOB LIBFBJNI_INCLUDE_DIR "${BUILD_DIR}/fbjni-*-headers.jar/") | ||
|
||
target_link_libraries(sequel android log) | ||
target_include_directories( | ||
${PACKAGE_NAME} | ||
PRIVATE | ||
# --- fbjni --- | ||
"${LIBFBJNI_INCLUDE_DIR}" | ||
# --- React Native --- | ||
"${NODE_MODULES_DIR}/react-native/React" | ||
"${NODE_MODULES_DIR}/react-native/React/Base" | ||
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni" | ||
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker" | ||
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi" | ||
"${NODE_MODULES_DIR}/hermes-engine/android/include/" | ||
${INCLUDE_JSI_CPP} # only on older RN versions | ||
${INCLUDE_JSIDYNAMIC_CPP} # only on older RN versions | ||
) | ||
|
||
file (GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}") | ||
|
||
find_library( | ||
FBJNI_LIB | ||
fbjni | ||
PATHS ${LIBRN_DIR} | ||
NO_CMAKE_FIND_ROOT_PATH | ||
) | ||
|
||
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() | ||
|
||
find_library( | ||
LOG_LIB | ||
log | ||
) | ||
|
||
# target_link_libraries(sequel fbjni::fbjni android log) | ||
target_link_libraries( | ||
${PACKAGE_NAME} | ||
${LOG_LIB} | ||
${JSI_LIB} | ||
${REACT_NATIVE_JNI_LIB} | ||
${FBJNI_LIB} | ||
android | ||
) |
Oops, something went wrong.