1/*
2 * Copyright (C) 2020 Arm Limited.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18package {
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22soong_config_module_type {
23	name: "arm_gralloc_core_cc_defaults",
24	module_type: "cc_defaults",
25	config_namespace: "arm_gralloc",
26	variables: [
27		"gralloc_ion_sync_on_lock",
28	],
29	properties: [
30		"cflags",
31	],
32}
33
34soong_config_bool_variable {
35	name: "gralloc_ion_sync_on_lock",
36}
37
38arm_gralloc_core_cc_defaults {
39	name: "arm_gralloc_core_defaults",
40	defaults: [
41		"arm_gralloc_defaults",
42		"android.hardware.graphics.common-ndk_shared",
43	],
44	soong_config_variables: {
45		gralloc_ion_sync_on_lock: {
46			cflags: [
47				"-DGRALLOC_ION_SYNC_ON_LOCK=1",
48			],
49		},
50	},
51	srcs: [
52		"mali_gralloc_bufferaccess.cpp",
53		"mali_gralloc_bufferallocation.cpp",
54		"mali_gralloc_bufferdescriptor.cpp",
55		"mali_gralloc_formats.cpp",
56		"mali_gralloc_reference.cpp",
57		"format_info.cpp",
58	],
59	include_dirs: [
60		"hardware/google/gchips/include",
61	],
62	header_libs: [
63		"device_kernel_headers",
64	],
65	static_libs: [
66		"libarect",
67	],
68	shared_libs: [
69		"liblog",
70		"libcutils",
71		"libutils",
72		"android.hardware.graphics.common@1.2",
73	],
74	target: {
75		android: {
76			shared_libs: [
77				"libhardware",
78			],
79		},
80	},
81}
82
83cc_library_static {
84	name: "libgralloc_core",
85	defaults: [
86		"arm_gralloc_core_defaults",
87		"arm_gralloc_version_defaults",
88	],
89}
90