blob: 83987940d637d2270f7aa7a81fd89121cac31d67 [file] [log] [blame]
Dan Willemsen3106c1c2016-10-03 23:56:51 -07001// Copyright 2010 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
Bob Badour3c538232021-02-12 21:26:48 -080014package {
15 // See: http://go/android-license-faq
16 // A large-scale-change added 'default_applicable_licenses' to import
17 // all of the 'license_kinds' from "frameworks_native_license"
18 // to get the below license kinds:
19 // SPDX-license-identifier-Apache-2.0
20 default_applicable_licenses: ["frameworks_native_license"],
21}
22
Jiyong Park172bd722017-06-21 12:14:18 +090023cc_library_headers {
24 name: "libgui_headers",
25 vendor_available: true,
26 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070027
28 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070029 export_shared_lib_headers: [
30 "android.hidl.token@1.0-utils",
31 "android.hardware.graphics.bufferqueue@1.0",
32 "android.hardware.graphics.bufferqueue@2.0",
33 ],
34 shared_libs: [
35 "android.hidl.token@1.0-utils",
36 "android.hardware.graphics.bufferqueue@1.0",
37 "android.hardware.graphics.bufferqueue@2.0",
38 ],
Jooyung Han7bcb8932020-04-16 18:48:32 +090039 min_sdk_version: "29",
Jiyong Park172bd722017-06-21 12:14:18 +090040}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041
42cc_library_shared {
43 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +090044 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090045 vndk: {
46 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +090047 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090048 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090049 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070050
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070051 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070052
53 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +090054 ":framework_native_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -070055 ":libgui_bufferqueue_sources",
56
Dan Willemsen3106c1c2016-10-03 23:56:51 -070057 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070058 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080059 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080060 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070061 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070062 "ConsumerBase.cpp",
63 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070064 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -070065 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070066 "DisplayEventReceiver.cpp",
67 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070068 "GuiConfig.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080069 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070070 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080071 "IGraphicBufferConsumer.cpp",
72 "IGraphicBufferProducer.cpp",
73 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080074 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070075 "ISurfaceComposer.cpp",
76 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070077 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080078 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080079 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070080 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080081 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070082 "StreamSplitter.cpp",
83 "Surface.cpp",
84 "SurfaceControl.cpp",
85 "SurfaceComposerClient.cpp",
86 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080087 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080088 "bufferqueue/1.0/B2HProducerListener.cpp",
89 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
90 "bufferqueue/2.0/B2HProducerListener.cpp",
91 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070092 ],
93
94 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080095 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -080096 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070097 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070098 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080099 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800100 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700101 ],
102
Chong Zhang62493092020-01-15 16:04:47 -0800103 export_shared_lib_headers: [
104 "libbinder",
105 ],
106
Jiyong Parka75d3d62018-04-09 12:16:30 +0900107 // bufferhub is not used when building libgui for vendors
108 target: {
109 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800110 cflags: [
111 "-DNO_BUFFERHUB",
112 "-DNO_INPUT",
113 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900114 exclude_srcs: [
115 "BufferHubConsumer.cpp",
116 "BufferHubProducer.cpp",
117 ],
118 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800119 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700120 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900121 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800122 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800123 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900124 ],
125 },
126 },
127
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700128 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800129 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900130 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700131 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900132
133 aidl: {
134 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800135 },
136
137 pgo: {
138 sampling: true,
139 profile_file: "libgui/libgui.profdata",
140 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800141
142 lto: {
143 thin: true,
144 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700145}
146
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700147// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700148// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700149cc_library_static {
150 name: "libgui_bufferqueue_static",
151 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900152 apex_available: [
153 "//apex_available:platform",
154 "com.android.media.swcodec",
155 ],
156 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700157
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700158 cflags: [
159 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800160 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700161 ],
162
163 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700164
165 srcs: [
166 ":libgui_bufferqueue_sources",
167 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700168}
169
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700170filegroup {
171 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700172 srcs: [
173 "BufferItem.cpp",
174 "BufferQueue.cpp",
175 "BufferQueueConsumer.cpp",
176 "BufferQueueCore.cpp",
177 "BufferQueueProducer.cpp",
178 "BufferQueueThreadState.cpp",
179 "BufferSlot.cpp",
180 "FrameTimestamps.cpp",
181 "GLConsumerUtils.cpp",
182 "HdrMetadata.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800183 "QueueBufferInputOutput.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700184 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700185 "bufferqueue/1.0/H2BProducerListener.cpp",
186 "bufferqueue/1.0/WProducerListener.cpp",
187 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700188 "bufferqueue/2.0/H2BProducerListener.cpp",
189 "bufferqueue/2.0/types.cpp",
190 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700191}
192
193// Common build config shared by libgui and libgui_bufferqueue_static.
194cc_defaults {
195 name: "libgui_bufferqueue-defaults",
196
197 clang: true,
198 cflags: [
199 "-Wall",
200 "-Werror",
201 ],
202
203 cppflags: [
204 "-Wextra",
205 "-DDEBUG_ONLY_CODE=0",
206 ],
207
208 product_variables: {
209 eng: {
210 cppflags: [
211 "-UDEBUG_ONLY_CODE",
212 "-DDEBUG_ONLY_CODE=1",
213 ],
214 },
215 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700216
David Stevens7347f0b2020-01-15 20:19:22 +0900217 whole_static_libs: [
218 "LibGuiProperties",
219 ],
220
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700221 shared_libs: [
222 "android.hardware.graphics.bufferqueue@1.0",
223 "android.hardware.graphics.bufferqueue@2.0",
224 "android.hardware.graphics.common@1.1",
225 "android.hardware.graphics.common@1.2",
226 "android.hidl.token@1.0-utils",
227 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700228 "libcutils",
229 "libEGL",
230 "libGLESv2",
231 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700232 "liblog",
233 "libnativewindow",
234 "libsync",
235 "libui",
236 "libutils",
237 "libvndksupport",
238 ],
239
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800240 static_libs: [
241 "libbinderthreadstateutils",
242 ],
243
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700244 header_libs: [
245 "libgui_headers",
246 "libnativebase_headers",
247 ],
248
249 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700250 "libEGL",
251 "libnativewindow",
252 "libui",
253 "android.hardware.graphics.bufferqueue@1.0",
254 "android.hardware.graphics.bufferqueue@2.0",
255 "android.hardware.graphics.common@1.1",
256 "android.hardware.graphics.common@1.2",
257 "android.hidl.token@1.0-utils",
258 ],
259
260 export_header_lib_headers: [
261 "libgui_headers",
262 ],
263
264 export_include_dirs: [
265 "include",
266 ],
267}
268
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700269// GMocks for use by external code
270cc_library_static {
271 name: "libgui_mocks",
272 vendor_available: false,
273
274 defaults: ["libgui_bufferqueue-defaults"],
275 static_libs: [
276 "libgtest",
277 "libgmock",
278 ],
279
280 srcs: [
281 "mock/GraphicBufferConsumer.cpp",
282 "mock/GraphicBufferProducer.cpp",
283 ],
284}
285
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700286subdirs = ["tests"]