Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3347226
D6484.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6484.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)
@@ -152,11 +161,6 @@
# symlinked React Native headers
../headers
- # external libs
- ${_third_party_dir}/folly
- ${_third_party_dir}/boost/boost_${BOOST_VERSION}
- ${_third_party_dir}/double-conversion
-
# comm android specific code
./src/cpp
@@ -175,29 +179,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 +222,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,29 @@
+find_library(
+ folly-lib
+ folly_runtime
+ PATHS ${LIBRN_DIR}
+ NO_CMAKE_FIND_ROOT_PATH
+)
+
+list(APPEND _folly_includes
+ "${_third_party_dir}/folly"
+ "${_third_party_dir}/boost/boost_${BOOST_VERSION}"
+ "${_third_party_dir}/double-conversion"
+ "${_third_party_dir}/glog/glog-${GLOG_VERSION}"
+)
+
+list(APPEND _folly_options
+ -DFOLLY_NO_CONFIG=1
+ -DFOLLY_HAVE_CLOCK_GETTIME=1
+ -DFOLLY_HAVE_MEMRCHR=1
+ -DFOLLY_USE_LIBCPP=1
+ -DFOLLY_MOBILE=1
+)
+
+add_library(Folly::folly SHARED IMPORTED)
+set_target_properties(Folly::folly PROPERTIES
+ IMPORTED_LOCATION "${folly-lib}"
+ INTERFACE_INCLUDE_DIRECTORIES "${_folly_includes}"
+ INTERFACE_LINK_LIBRARIES glog::glog
+ INTERFACE_COMPILE_OPTIONS "${_folly_options}"
+)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 11:24 AM (18 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570415
Default Alt Text
D6484.diff (2 KB)
Attached To
Mode
D6484: [Android] Promote folly to library target
Attached
Detach File
Event Timeline
Log In to Comment