Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32600290
D6484.1767431547.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6484.1767431547.diff
View Options
diff --git a/native/android/app/CMakeLists.txt b/native/android/app/CMakeLists.txt
--- a/native/android/app/CMakeLists.txt
+++ b/native/android/app/CMakeLists.txt
@@ -80,6 +80,15 @@
add_subdirectory(${_third_party_dir}/glog/glog-${GLOG_VERSION}/)
+file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}/${ANDROID_ABI}")
+if (NOT LIBRN_DIR)
+ # If /${ANDROID_ABI} dir not found, then ${REACT_NATIVE_SO_DIR} is probably:
+ # ReactAndroid/build/react-ndk/exported
+ file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}")
+endif ()
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/folly-target.cmake)
+
add_subdirectory(../../node_modules/olm ./build)
set(_node_modules_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../node_modules)
@@ -153,7 +162,6 @@
../headers
# external libs
- ${_third_party_dir}/folly
${_third_party_dir}/boost/boost_${BOOST_VERSION}
${_third_party_dir}/double-conversion
@@ -175,29 +183,6 @@
${native_rust_library_include_dir}
)
-file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}/${ANDROID_ABI}")
-if (NOT LIBRN_DIR)
- # If /${ANDROID_ABI} dir not found, then ${REACT_NATIVE_SO_DIR} is probably:
- # ReactAndroid/build/react-ndk/exported
- file(GLOB LIBRN_DIR "${REACT_NATIVE_SO_DIR}")
-endif ()
-
-find_library(
- folly-lib
- folly_runtime
- PATHS ${LIBRN_DIR}
- NO_CMAKE_FIND_ROOT_PATH
-)
-
-target_compile_options(
- ${PACKAGE_NAME}
- PRIVATE -DFOLLY_NO_CONFIG=1
- -DFOLLY_HAVE_CLOCK_GETTIME=1
- -DFOLLY_HAVE_MEMRCHR=1
- -DFOLLY_USE_LIBCPP=1
- -DFOLLY_MOBILE=1
-)
-
add_definitions(
# SQLCipher
-DSQLITE_THREADSAFE=0
@@ -241,7 +226,7 @@
fbjni::fbjni
android
${log-lib}
- ${folly-lib}
+ Folly::folly
glog::glog
olm
openssl-crypto
diff --git a/native/android/app/cmake/folly-target.cmake b/native/android/app/cmake/folly-target.cmake
new file mode 100644
--- /dev/null
+++ b/native/android/app/cmake/folly-target.cmake
@@ -0,0 +1,22 @@
+find_library(
+ folly-lib
+ folly_runtime
+ PATHS ${LIBRN_DIR}
+ NO_CMAKE_FIND_ROOT_PATH
+)
+
+add_library(Folly::folly SHARED IMPORTED)
+set_target_properties(Folly::folly PROPERTIES
+ IMPORTED_LOCATION "${folly-lib}"
+ INTERFACE_INCLUDE_DIRECTORIES "${_third_party_dir}/folly;${_third_party_dir}/boost/boost_${BOOST_VERSION};${_third_party_dir}/double-conversion;${_third_party_dir}/glog/glog-${GLOG_VERSION}"
+ INTERFACE_LINK_LIBRARIES glog::glog
+)
+
+target_compile_options(
+ Folly::folly
+ INTERFACE -DFOLLY_NO_CONFIG=1
+ -DFOLLY_HAVE_CLOCK_GETTIME=1
+ -DFOLLY_HAVE_MEMRCHR=1
+ -DFOLLY_USE_LIBCPP=1
+ -DFOLLY_MOBILE=1
+)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 3, 9:12 AM (6 m, 44 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5887442
Default Alt Text
D6484.1767431547.diff (2 KB)
Attached To
Mode
D6484: [Android] Promote folly to library target
Attached
Detach File
Event Timeline
Log In to Comment