blob: fa853cb1067e8c936e1fa82ac66fdce781cbefea [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 Badour3306e492021-02-25 15:35:37 -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
Alec Mouricdedc5d2021-03-01 22:39:55 -080042cc_library_headers {
43 name: "libgui_aidl_headers",
44 vendor_available: true,
45 static_libs: [
46 "libgui_aidl_static",
47 ],
48
49 export_static_lib_headers: [
50 "libgui_aidl_static",
51 ],
52}
53
Pablo Gamito6ee484d2020-07-30 14:26:28 +000054filegroup {
55 name: "libgui_aidl",
56 srcs: ["aidl/**/*.aidl"],
57 path: "aidl/",
58}
59
Alec Mouricdedc5d2021-03-01 22:39:55 -080060cc_library_static {
61 name: "libgui_aidl_static",
62 vendor_available: true,
63 srcs: [
64 ":libgui_aidl",
65 ],
66
67 shared_libs: [
68 "libbinder",
69 "libui",
70 ],
71
72 local_include_dirs: [
73 "include",
74 ],
75
76 export_shared_lib_headers: [
77 "libbinder",
78 ],
79
80 aidl: {
Yi Kong7cd72c52021-12-23 15:51:29 +080081 export_aidl_headers: true,
82 },
Alec Mouricdedc5d2021-03-01 22:39:55 -080083}
84
Dan Willemsen3106c1c2016-10-03 23:56:51 -070085cc_library_shared {
86 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +090087 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090088 vndk: {
89 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +090090 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090091 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090092 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070093
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070094 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070095
Alec Mouricdedc5d2021-03-01 22:39:55 -080096 static_libs: [
97 "libgui_aidl_static",
98 ],
99 export_static_lib_headers: [
100 "libgui_aidl_static",
101 ],
102
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700103 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900104 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000105 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700106 ":libgui_bufferqueue_sources",
107
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700108 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700109 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800110 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800111 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700112 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700113 "ConsumerBase.cpp",
114 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700115 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700116 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700117 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000118 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700119 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800120 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700121 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800122 "IGraphicBufferConsumer.cpp",
123 "IGraphicBufferProducer.cpp",
124 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800125 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700126 "ISurfaceComposer.cpp",
127 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700128 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800129 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800130 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700131 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800132 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700133 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800134 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700135 "Surface.cpp",
136 "SurfaceControl.cpp",
137 "SurfaceComposerClient.cpp",
138 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000139 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800140 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800141 "bufferqueue/1.0/B2HProducerListener.cpp",
142 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
143 "bufferqueue/2.0/B2HProducerListener.cpp",
144 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700145 ],
146
147 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800148 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700149 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700150 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800151 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800152 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700153 ],
154
Chong Zhang62493092020-01-15 16:04:47 -0800155 export_shared_lib_headers: [
156 "libbinder",
Vishnu Naire798b472020-07-23 13:52:21 -0700157 "libinput",
Chong Zhang62493092020-01-15 16:04:47 -0800158 ],
159
Alec Mouricdedc5d2021-03-01 22:39:55 -0800160 export_header_lib_headers: [
161 "libgui_aidl_headers",
162 ],
163
Jiyong Parka75d3d62018-04-09 12:16:30 +0900164 // bufferhub is not used when building libgui for vendors
165 target: {
166 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800167 cflags: [
168 "-DNO_BUFFERHUB",
169 "-DNO_INPUT",
170 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900171 exclude_srcs: [
172 "BufferHubConsumer.cpp",
173 "BufferHubProducer.cpp",
174 ],
175 exclude_shared_libs: [
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700176 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900177 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800178 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800179 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900180 ],
181 },
182 },
183
Daichi Hironof474d3d2019-11-05 08:54:07 +0900184 aidl: {
185 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800186 },
187
Alec Mouricdedc5d2021-03-01 22:39:55 -0800188 header_libs: [
189 "libdvr_headers",
190 "libgui_aidl_headers",
191 "libpdx_headers",
192 ],
193
Yi Kong7cd72c52021-12-23 15:51:29 +0800194 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800195
196 lto: {
197 thin: true,
198 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700199}
200
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700201// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700202// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700203cc_library_static {
204 name: "libgui_bufferqueue_static",
205 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900206 apex_available: [
207 "//apex_available:platform",
208 "com.android.media.swcodec",
209 ],
210 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700211
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700212 cflags: [
213 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800214 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700215 ],
216
217 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700218
219 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000220 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700221 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800222 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700223 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700224}
225
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700226filegroup {
227 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700228 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700229 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700230 "BufferItem.cpp",
231 "BufferQueue.cpp",
232 "BufferQueueConsumer.cpp",
233 "BufferQueueCore.cpp",
234 "BufferQueueProducer.cpp",
235 "BufferQueueThreadState.cpp",
236 "BufferSlot.cpp",
237 "FrameTimestamps.cpp",
238 "GLConsumerUtils.cpp",
239 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700240 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700241 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700242 "bufferqueue/1.0/H2BProducerListener.cpp",
243 "bufferqueue/1.0/WProducerListener.cpp",
244 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700245 "bufferqueue/2.0/H2BProducerListener.cpp",
246 "bufferqueue/2.0/types.cpp",
247 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700248}
249
250// Common build config shared by libgui and libgui_bufferqueue_static.
251cc_defaults {
252 name: "libgui_bufferqueue-defaults",
253
254 clang: true,
255 cflags: [
256 "-Wall",
257 "-Werror",
258 ],
259
260 cppflags: [
261 "-Wextra",
262 "-DDEBUG_ONLY_CODE=0",
263 ],
264
265 product_variables: {
266 eng: {
267 cppflags: [
268 "-UDEBUG_ONLY_CODE",
269 "-DDEBUG_ONLY_CODE=1",
270 ],
271 },
272 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700273
David Stevens7347f0b2020-01-15 20:19:22 +0900274 whole_static_libs: [
275 "LibGuiProperties",
276 ],
277
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700278 shared_libs: [
279 "android.hardware.graphics.bufferqueue@1.0",
280 "android.hardware.graphics.bufferqueue@2.0",
281 "android.hardware.graphics.common@1.1",
282 "android.hardware.graphics.common@1.2",
283 "android.hidl.token@1.0-utils",
284 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700285 "libcutils",
286 "libEGL",
287 "libGLESv2",
288 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700289 "liblog",
290 "libnativewindow",
291 "libsync",
292 "libui",
293 "libutils",
294 "libvndksupport",
295 ],
296
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800297 static_libs: [
298 "libbinderthreadstateutils",
299 ],
300
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700301 header_libs: [
302 "libgui_headers",
303 "libnativebase_headers",
304 ],
305
Ady Abraham62f216c2020-10-13 19:07:23 -0700306 include_dirs: [
307 "frameworks/native/include",
308 ],
309
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700310 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700311 "libEGL",
312 "libnativewindow",
313 "libui",
314 "android.hardware.graphics.bufferqueue@1.0",
315 "android.hardware.graphics.bufferqueue@2.0",
316 "android.hardware.graphics.common@1.1",
317 "android.hardware.graphics.common@1.2",
318 "android.hidl.token@1.0-utils",
319 ],
320
321 export_header_lib_headers: [
322 "libgui_headers",
323 ],
324
325 export_include_dirs: [
326 "include",
327 ],
328}
329
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700330// GMocks for use by external code
331cc_library_static {
332 name: "libgui_mocks",
333 vendor_available: false,
334
335 defaults: ["libgui_bufferqueue-defaults"],
336 static_libs: [
337 "libgtest",
338 "libgmock",
339 ],
340
341 srcs: [
342 "mock/GraphicBufferConsumer.cpp",
343 "mock/GraphicBufferProducer.cpp",
344 ],
345}
346
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700347subdirs = ["tests"]