Simplify the av1 extension build system
Also add cpu_features to .hgignore. PiperOrigin-RevId: 323804458
This commit is contained in:
parent
6054bda028
commit
867d45ca62
@ -65,6 +65,7 @@ extensions/vp9/src/main/jni/libyuv
|
||||
|
||||
# AV1 extension
|
||||
extensions/av1/src/main/jni/libgav1
|
||||
extensions/av1/src/main/jni/cpu_features
|
||||
|
||||
# Opus extension
|
||||
extensions/opus/src/main/jni/libopus
|
||||
|
@ -39,7 +39,7 @@ git clone https://github.com/google/cpu_features
|
||||
|
||||
```
|
||||
cd "${AV1_EXT_PATH}/jni" && \
|
||||
git clone https://chromium.googlesource.com/codecs/libgav1 libgav1
|
||||
git clone https://chromium.googlesource.com/codecs/libgav1
|
||||
```
|
||||
|
||||
* Fetch Abseil:
|
||||
|
@ -24,27 +24,10 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This option resolves the problem of finding libgav1JNI.so
|
||||
// on multiple paths. The first one found is picked.
|
||||
packagingOptions {
|
||||
pickFirst 'lib/arm64-v8a/libgav1JNI.so'
|
||||
pickFirst 'lib/armeabi-v7a/libgav1JNI.so'
|
||||
pickFirst 'lib/x86/libgav1JNI.so'
|
||||
pickFirst 'lib/x86_64/libgav1JNI.so'
|
||||
}
|
||||
|
||||
sourceSets.main {
|
||||
// As native JNI library build is invoked from gradle, this is
|
||||
// not needed. However, it exposes the built library and keeps
|
||||
// consistency with the other extensions.
|
||||
jniLibs.srcDir 'src/main/libs'
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the native build only if libgav1 is present, to avoid gradle sync
|
||||
// failures if libgav1 hasn't been checked out according to the README and CMake
|
||||
// isn't installed.
|
||||
// Configure the native build only if libgav1 is present to avoid gradle sync
|
||||
// failures if libgav1 hasn't been built according to the README instructions.
|
||||
if (project.file('src/main/jni/libgav1').exists()) {
|
||||
android.externalNativeBuild.cmake.path = 'src/main/jni/CMakeLists.txt'
|
||||
android.externalNativeBuild.cmake.version = '3.7.1+'
|
||||
|
@ -1,7 +1,4 @@
|
||||
# libgav1JNI requires modern CMake.
|
||||
cmake_minimum_required(VERSION 3.7.1 FATAL_ERROR)
|
||||
|
||||
# libgav1JNI requires C++11.
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
project(libgav1JNI C CXX)
|
||||
@ -21,24 +18,13 @@ if(build_type MATCHES "^rel")
|
||||
endif()
|
||||
|
||||
set(libgav1_jni_root "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(libgav1_jni_build "${CMAKE_BINARY_DIR}")
|
||||
set(libgav1_jni_output_directory
|
||||
${libgav1_jni_root}/../libs/${ANDROID_ABI}/)
|
||||
|
||||
set(libgav1_root "${libgav1_jni_root}/libgav1")
|
||||
set(libgav1_build "${libgav1_jni_build}/libgav1")
|
||||
|
||||
set(cpu_features_root "${libgav1_jni_root}/cpu_features")
|
||||
set(cpu_features_build "${libgav1_jni_build}/cpu_features")
|
||||
|
||||
# Build cpu_features library.
|
||||
add_subdirectory("${cpu_features_root}"
|
||||
"${cpu_features_build}"
|
||||
add_subdirectory("${libgav1_jni_root}/cpu_features"
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
# Build libgav1.
|
||||
add_subdirectory("${libgav1_root}"
|
||||
"${libgav1_build}"
|
||||
add_subdirectory("${libgav1_jni_root}/libgav1"
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
# Build libgav1JNI.
|
||||
@ -58,7 +44,3 @@ target_link_libraries(gav1JNI
|
||||
PRIVATE libgav1_static
|
||||
PRIVATE ${android_log_lib})
|
||||
|
||||
# Specify output directory for libgav1JNI.
|
||||
set_target_properties(gav1JNI PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY
|
||||
${libgav1_jni_output_directory})
|
||||
|
Loading…
x
Reference in New Issue
Block a user