Build libsession-util during session-android build

This is definitely easier than needing to muck around with downloading
the .a.
This commit is contained in:
Jason Rhinelander 2022-11-29 00:56:18 -04:00 committed by 0x330a
parent 0eae6b8a94
commit ce51512368
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C
3 changed files with 11 additions and 9 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "libsession-util/libsession-util"]
path = libsession-util/libsession-util
url = https://github.com/jagerman/libsession-util.git

@ -0,0 +1 @@
Subproject commit e52fc314e5a5659de7c2bb60bb29dc52b80b9ace

View File

@ -14,6 +14,9 @@ project("session_util")
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.
set(BUILD_SHARED_LIBS ON CACHE BOOL "")
add_subdirectory(../../../libsession-util libsession)
add_library( # Sets the name of the library.
session_util
@ -37,13 +40,6 @@ find_library( # Sets the name of the path variable.
log)
# Add the libsession-util library here
set(distribution_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../distribution)
add_library(external-libsession-util STATIC IMPORTED)
set_target_properties(external-libsession-util PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/libsession-util-android/lib/${ANDROID_ABI}/libsession-util.a)
target_include_directories(session_util PRIVATE
${distribution_DIR}/libsession-util-android/include)
# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
@ -51,7 +47,9 @@ target_include_directories(session_util PRIVATE
target_link_libraries( # Specifies the target library.
session_util
external-libsession-util
PUBLIC
libsession::config
libsession::crypto
# Links the target library to the log library
# included in the NDK.
${log-lib})