Avoid sync failures if libgav1 isn't present

PiperOrigin-RevId: 273734495
This commit is contained in:
sofijajvc 2019-10-09 14:33:30 +01:00 committed by Ian Baker
parent 3d0886f458
commit 1312a54295

View File

@ -54,13 +54,15 @@ android {
}
}
// Check that the Android NDK and CMake are present, to avoid gradle sync
// failures if they aren't installed. To use the extension it is necessary to
// install the NDK and CMake from the SDK Manager.
// Check that the Android NDK, CMake and libgav1 are present, to avoid gradle
// sync failures if the tools aren't installed or libgav1 is missing. To use
// the extension it is necessary to install the NDK and CMake from the SDK
// Manager and fetch libgav1 following the steps in README.
def ndkDirectory = project.android.ndkDirectory
def sdkDirectory = project.android.sdkDirectory
if (ndkDirectory != null && !ndkDirectory.toString().isEmpty()
&& new File(sdkDirectory.toString() + '/cmake').exists()) {
&& new File(sdkDirectory.toString() + '/cmake').exists()
&& project.file('src/main/jni/libgav1').exists()) {
android.externalNativeBuild.cmake.path = 'src/main/jni/CMakeLists.txt'
android.externalNativeBuild.cmake.version = '3.7.1+'
}