blob: 9f91b2a2c9f3ea74143dd67b78bb3c0b55d59906 [file] [log] [blame]
Trevor McGuireb7854fb2021-07-23 16:42:47 -07001/*
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
Tiem Songee0da742024-01-03 14:08:46 -080017/**
18 * This file was created using the `create_project.py` script located in the
19 * `<AndroidX root>/development/project-creator` directory.
20 *
21 * Please use that script when creating a new project, rather than copying an existing project and
22 * modifying its settings.
23 */
Dustin Lam0a035d92021-11-29 11:54:36 -080024import androidx.build.LibraryType
Dustin Lam0a035d92021-11-29 11:54:36 -080025
Trevor McGuireb7854fb2021-07-23 16:42:47 -070026apply plugin: 'AndroidXPlugin'
27apply plugin: 'com.android.library'
28
29ext {
30 yuvSourceDir = "${project.rootDir.absolutePath}/../../external/libyuv"
31}
32
33android {
34 defaultConfig {
35 externalNativeBuild {
36 cmake {
Will McVicker0c79faa2024-01-18 15:05:27 -080037 arguments "-DCMAKE_POLICY_DEFAULT_CMP0064=NEW",
38 "-DCMAKE_VERBOSE_MAKEFILE=ON"
Trevor McGuireb7854fb2021-07-23 16:42:47 -070039 // Build only the static library target
40 targets "yuv"
41 }
42 }
43 }
44
45 externalNativeBuild {
46 cmake {
Aurimas Liutikas77952822024-12-04 18:00:17 -080047 version = libs.versions.cmake.get()
Alan Viverettebee83bf2023-08-28 12:45:31 -040048 path "${yuvSourceDir}/CMakeLists.txt"
Trevor McGuireb7854fb2021-07-23 16:42:47 -070049 }
50 }
51
52 // Enable generation of Prefab packages and include them in the library's AAR.
53 buildFeatures {
Aurimas Liutikas77952822024-12-04 18:00:17 -080054 prefabPublishing = true
Trevor McGuireb7854fb2021-07-23 16:42:47 -070055 }
56
57 // Include the "libyuv" module from the native build system in the AAR,
Alan Viverettebee83bf2023-08-28 12:45:31 -040058 // and export the headers in include to its consumers
Trevor McGuireb7854fb2021-07-23 16:42:47 -070059 prefab {
60 libyuv {
Aurimas Liutikas77952822024-12-04 18:00:17 -080061 headers = "${yuvSourceDir}/include"
62 name = "yuv"
Trevor McGuireb7854fb2021-07-23 16:42:47 -070063 }
64 }
Aurimas Liutikas77952822024-12-04 18:00:17 -080065 namespace = "com.google.libyuv"
Jeff Gastona4baa262021-11-02 15:29:55 -040066}
67
Dustin Lam0a035d92021-11-29 11:54:36 -080068androidx {
69 name = "libyuv"
70 // Only intended to be used as snapshots, do not change to PUBLISHED.
Omar Ismaila293b972024-12-16 12:18:54 +000071 type = LibraryType.SNAPSHOT_ONLY_LIBRARY
Dustin Lam0a035d92021-11-29 11:54:36 -080072 inceptionYear = "2021"
73 description = "libyuv is an open source project that includes YUV scaling and conversion functionality."
74}