| Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | apply plugin: 'AndroidXPlugin' |
| 18 | apply plugin: 'com.android.library' |
| 19 | |
| 20 | ext { |
| 21 | yuvSourceDir = "${project.rootDir.absolutePath}/../../external/libyuv" |
| 22 | } |
| 23 | |
| 24 | android { |
| 25 | defaultConfig { |
| 26 | externalNativeBuild { |
| 27 | cmake { |
| 28 | arguments "-DCMAKE_POLICY_DEFAULT_CMP0064=NEW", "-DCMAKE_VERBOSE_MAKEFILE=ON" |
| 29 | // Build only the static library target |
| 30 | targets "yuv" |
| 31 | } |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | externalNativeBuild { |
| 36 | cmake { |
| 37 | version "3.10.2" |
| 38 | path "${yuvSourceDir}/files/CMakeLists.txt" |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // Enable generation of Prefab packages and include them in the library's AAR. |
| 43 | buildFeatures { |
| 44 | prefabPublishing true |
| 45 | } |
| 46 | |
| 47 | // Include the "libyuv" module from the native build system in the AAR, |
| 48 | // and export the headers in files/include to its consumers |
| 49 | prefab { |
| 50 | libyuv { |
| 51 | headers "${yuvSourceDir}/files/include" |
| 52 | name "yuv" |
| 53 | } |
| 54 | } |
| 55 | } |