Commit 6ced6a51 authored by Thomas Guillem's avatar Thomas Guillem

build: build VLC libs inside vlc build dir

This will allow the following:

 ~/git/vlc $ ../vlc-android/compile-libvlc.sh -a arm64

Run an android build from a vlc source dir.
parent 95a767fd
......@@ -170,7 +170,7 @@ else
fi
VLC_BUILD_DIR=`realpath $VLC_SRC_DIR/build-android-${TARGET_TUPLE}`
VLC_OUT_PATH="$SRC_DIR/build/ndk"
VLC_OUT_PATH="$VLC_BUILD_DIR/ndk"
VLC_OUT_LDLIBS="-L$VLC_OUT_PATH/libs/${ANDROID_ABI} -lvlc"
avlc_checkfail()
......@@ -678,7 +678,7 @@ LOCAL_CXXFLAGS := -std=c++11
include $(BUILD_SHARED_LIBRARY)
EOF
$NDK_BUILD -C build \
$NDK_BUILD -C $VLC_OUT_PATH/.. \
APP_STL="c++_shared" \
APP_CPPFLAGS="-frtti -fexceptions" \
VLC_SRC_DIR="$VLC_SRC_DIR" \
......
......@@ -326,8 +326,11 @@ if [ "$ANDROID_ABI" = "all" ]; then
(ANDROID_ABI=x86_64 RELEASE=$RELEASE compile $copy_tmp)
rm -rf $LIB_DIR/jni/libs/
mv build/tmp $LIB_DIR/jni/libs/
GRADLE_VLC_SRC_DIRS="''"
else
compile
GRADLE_VLC_SRC_DIRS="$VLC_OUT_PATH/libs"
fi
##################
......@@ -341,10 +344,10 @@ elif [ "$RELEASE" = 1 ]; then
fi
if [ "$BUILD_LIBVLC" = 1 ];then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc assemble${BUILDTYPE}
GRADLE_VLC_SRC_DIRS="$GRADLE_VLC_SRC_DIRS" GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc assemble${BUILDTYPE}
RUN=0
if [ "$PUBLISH" = 1 ];then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc install bintrayUpload
GRADLE_VLC_SRC_DIRS="$GRADLE_VLC_SRC_DIRS" GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc install bintrayUpload
fi
elif [ "$BUILD_MEDIALIB" = 1 ]; then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p medialibrary assemble${BUILDTYPE}
......@@ -359,7 +362,7 @@ else
ACTION="assemble"
fi
TARGET="${ACTION}${BUILDTYPE}"
CLI="" GRADLE_ABI=$GRADLE_ABI ./gradlew $TARGET
GRADLE_VLC_SRC_DIRS="$GRADLE_VLC_SRC_DIRS" CLI="" GRADLE_ABI=$GRADLE_ABI ./gradlew $TARGET
fi
#######
......
......@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
def vlcSrcDirs = System.getenv('GRADLE_VLC_SRC_DIRS')
ext {
library_version = '3.2-eap2'
repoName = 'Android'
......@@ -22,7 +23,8 @@ android {
sourceSets {
main {
jni.srcDirs = [] // Prevent gradle from building native code with ndk; we have our own Makefile for it.
jniLibs.srcDirs = [ 'jni/libs', '../build/ndk/libs' ] // Where generated .so files are placed.
jniLibs.srcDirs = [ 'jni/libs' ]
jniLibs.srcDirs += "$vlcSrcDirs"
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment