[Android] buildsystem: Use a prebuilt module to link medialibrary and libmla

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:43:56 2021 +0100| [3b3d417c1d0f95ee4da26188d5f5dda98a9e9d9e] | committer: Nicolas Pomepuy

buildsystem: Use a prebuilt module to link medialibrary and libmla

This way the build system realizes that it needs to rebuild the JNI
library if the libmedialibrary.a changes
refs #2264

> https://code.videolan.org/videolan/vlc-android/commit/3b3d417c1d0f95ee4da26188d5f5dda98a9e9d9e
---

 buildsystem/compile-medialibrary.sh | 1 -
 medialibrary/jni/Android.mk         | 7 +++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/buildsystem/compile-medialibrary.sh b/buildsystem/compile-medialibrary.sh
index aeb9d80a8..7117fdb60 100755
--- a/buildsystem/compile-medialibrary.sh
+++ b/buildsystem/compile-medialibrary.sh
@@ -169,7 +169,6 @@ avlc_checkfail "medialibrary: build failed"
 cd ${SRC_DIR}
 
 MEDIALIBRARY_LDLIBS="$VLC_OUT_LDLIBS \
--L${MEDIALIBRARY_BUILD_DIR}/build-android-$ANDROID_ABI/src/ -lmedialibrary \
 -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}"
diff --git a/medialibrary/jni/Android.mk b/medialibrary/jni/Android.mk
index 45de311a7..216894e38 100644
--- a/medialibrary/jni/Android.mk
+++ b/medialibrary/jni/Android.mk
@@ -1,7 +1,14 @@
 LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := medialibrary
+LOCAL_SRC_FILES := ../medialibrary/build-android-$(ANDROID_ABI)/src/libmedialibrary.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
 include $(BUILD_SHARED_LIBRARY)



More information about the Android mailing list