[Android] buildsystem: Use a prebuilt module for linking libmla with sqlite

Hugo Beauzée-Luyssen git at videolan.org
Thu Jan 6 13:11:10 UTC 2022


vlc-android | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Dec  3 17:50:27 2021 +0100| [8f3571d54386d84ed7ad6d000793472bed7be919] | committer: Nicolas Pomepuy

buildsystem: Use a prebuilt module for linking libmla with sqlite

This reduces the amount of variables and weird path we have to sprinkle
throughout the buildscript

> https://code.videolan.org/videolan/vlc-android/commit/8f3571d54386d84ed7ad6d000793472bed7be919
---

 buildsystem/compile-medialibrary.sh | 4 ++--
 medialibrary/jni/Android.mk         | 7 ++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/buildsystem/compile-medialibrary.sh b/buildsystem/compile-medialibrary.sh
index 7117fdb60..87bba98ff 100755
--- a/buildsystem/compile-medialibrary.sh
+++ b/buildsystem/compile-medialibrary.sh
@@ -170,7 +170,6 @@ cd ${SRC_DIR}
 
 MEDIALIBRARY_LDLIBS="$VLC_OUT_LDLIBS \
 -L$SRC_DIR/vlc/contrib/contrib-android-$TARGET_TUPLE/jpeg/.libs -ljpeg \
--L$MEDIALIBRARY_MODULE_DIR/$SQLITE_RELEASE/build-$ANDROID_ABI/.libs -lsqlite3 \
 -L${NDK_LIB_DIR} -lc++abi ${NDK_LIB_UNWIND}"
 
 $NDK_BUILD -C medialibrary \
@@ -183,6 +182,7 @@ $NDK_BUILD -C medialibrary \
   NDK_TOOLCHAIN_VERSION=clang \
   MEDIALIBRARY_LDLIBS="${MEDIALIBRARY_LDLIBS}" \
   MEDIALIBRARY_INCLUDE_DIR=${MEDIALIBRARY_BUILD_DIR}/include \
-  NDK_DEBUG=${NDK_DEBUG}
+  NDK_DEBUG=${NDK_DEBUG} \
+  SQLITE_RELEASE=$SQLITE_RELEASE
 
 avlc_checkfail "nkd-build medialibrary failed"
diff --git a/medialibrary/jni/Android.mk b/medialibrary/jni/Android.mk
index 216894e38..2bcd818ca 100644
--- a/medialibrary/jni/Android.mk
+++ b/medialibrary/jni/Android.mk
@@ -5,10 +5,15 @@ LOCAL_MODULE := medialibrary
 LOCAL_SRC_FILES := ../medialibrary/build-android-$(ANDROID_ABI)/src/libmedialibrary.a
 include $(PREBUILT_STATIC_LIBRARY)
 
+include $(CLEAR_VARS)
+LOCAL_MODULE := sqlite
+LOCAL_SRC_FILES := ../$(SQLITE_RELEASE)/build-$(ANDROID_ABI)/.libs/libsqlite3.a
+include $(PREBUILT_STATIC_LIBRARY)
+
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES := medialibrary.cpp AndroidMediaLibrary.cpp AndroidDeviceLister.cpp utils.cpp
 LOCAL_MODULE    := mla
 LOCAL_LDLIBS    := $(MEDIALIBRARY_LDLIBS) -llog
 LOCAL_C_INCLUDES := $(MEDIALIBRARY_INCLUDE_DIR)
-LOCAL_STATIC_LIBRARIES := medialibrary
+LOCAL_STATIC_LIBRARIES := medialibrary sqlite
 include $(BUILD_SHARED_LIBRARY)



More information about the Android mailing list