Skip to content

Commit 8a2adc7

Browse files
committed
feat: update to new build system
1 parent fe33b6d commit 8a2adc7

File tree

18 files changed

+2291
-1541
lines changed

18 files changed

+2291
-1541
lines changed

android/CMakeLists.txt

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,63 @@
11
cmake_minimum_required(VERSION 3.9.0)
22

3+
set (PACKAGE_NAME "react-native-fast-openpgp")
34
set (CMAKE_VERBOSE_MAKEFILE ON)
45
set (CMAKE_CXX_STANDARD 14)
56
set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
67

78
add_library(openpgp_bridge SHARED IMPORTED)
89

9-
1010
file(TO_CMAKE_PATH ${NODE_MODULES_DIR} NODE_MODULES_DIR)
1111

12-
1312
set_target_properties(openpgp_bridge
1413
PROPERTIES
1514
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopenpgp_bridge.so
16-
)
15+
)
16+
17+
include_directories(
18+
../cpp
19+
"${NODE_MODULES_DIR}/react-native/React"
20+
"${NODE_MODULES_DIR}/react-native/React/Base"
21+
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
22+
)
1723

1824
add_library(fast-openpgp
19-
SHARED
20-
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi/jsi/jsi.cpp"
25+
SHARED
2126
../cpp/react-native-fast-openpgp.cpp
22-
../cpp/react-native-fast-openpgp.h
2327
fast-openpgp-adapter.cpp
2428
)
2529

26-
include_directories(
27-
fast-openpgp
28-
PRIVATE
29-
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
30-
../cpp
30+
set_target_properties(
31+
fast-openpgp PROPERTIES
32+
CXX_STANDARD 14
33+
CXX_EXTENSIONS OFF
34+
POSITION_INDEPENDENT_CODE ON
3135
)
3236

33-
target_link_libraries(fast-openpgp
37+
file (GLOB LIBRN_DIR "${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}")
38+
39+
find_library(
40+
log-lib
41+
log
42+
)
43+
find_library(
44+
JSI_LIB
45+
jsi
46+
PATHS ${LIBRN_DIR}
47+
NO_CMAKE_FIND_ROOT_PATH
48+
)
49+
find_library(
50+
REACT_NATIVE_JNI_LIB
51+
reactnativejni
52+
PATHS ${LIBRN_DIR}
53+
NO_CMAKE_FIND_ROOT_PATH
54+
)
55+
56+
target_link_libraries(
57+
fast-openpgp
3458
openpgp_bridge
59+
${log-lib}
60+
${JSI_LIB}
61+
${REACT_NATIVE_JNI_LIB}
3562
android
36-
log)
63+
)

0 commit comments

Comments
 (0)