blob: 6641b7777c49386b03f8be4aa72d25e2b10c62e6 [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
chaviw3277faf2021-05-19 16:45:23 -050054// AIDL files that should be exposed to java
55filegroup {
56 name: "guiconstants_aidl",
57 srcs: [
Vishnu Nair4f2ea102021-09-02 09:52:48 -070058 "android/**/DropInputMode.aidl",
chaviw3277faf2021-05-19 16:45:23 -050059 "android/**/TouchOcclusionMode.aidl",
60 ],
61}
62
63cc_library_static {
64 name: "libgui_window_info_static",
65 vendor_available: true,
66 host_supported: true,
67 srcs: [
68 ":guiconstants_aidl",
69 "android/gui/FocusRequest.aidl",
70 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050071 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050072 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050073 "android/gui/WindowInfo.aidl",
74 "WindowInfo.cpp",
75 ],
76
77 shared_libs: [
78 "libbinder",
79 ],
80
81 local_include_dirs: [
82 "include",
83 ],
84
85 export_shared_lib_headers: [
86 "libbinder",
87 ],
88
89 static_libs: [
90 "libui-types",
91 ],
92
93 aidl: {
Alixfcd57762022-04-25 20:14:50 +000094 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -050095 },
96
97 include_dirs: [
98 "frameworks/native/include",
99 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100100
101 target: {
102 darwin: {
103 enabled: false,
104 },
105 },
chaviw3277faf2021-05-19 16:45:23 -0500106}
107
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000108filegroup {
109 name: "libgui_aidl",
110 srcs: ["aidl/**/*.aidl"],
111 path: "aidl/",
112}
113
Alec Mouricdedc5d2021-03-01 22:39:55 -0800114cc_library_static {
115 name: "libgui_aidl_static",
116 vendor_available: true,
117 srcs: [
118 ":libgui_aidl",
119 ],
120
121 shared_libs: [
122 "libbinder",
123 "libui",
124 ],
125
126 local_include_dirs: [
127 "include",
128 ],
129
130 export_shared_lib_headers: [
131 "libbinder",
132 ],
133
chaviw3277faf2021-05-19 16:45:23 -0500134 static_libs: [
135 "libui-types",
136 ],
137
Alec Mouricdedc5d2021-03-01 22:39:55 -0800138 aidl: {
Yi Kong7cd72c52021-12-23 15:51:29 +0800139 export_aidl_headers: true,
140 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800141}
142
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700143cc_library_shared {
144 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900145 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900146 vndk: {
147 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900148 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900149 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900150 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700151
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700152 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700153
Alec Mouricdedc5d2021-03-01 22:39:55 -0800154 static_libs: [
155 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500156 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800157 ],
158 export_static_lib_headers: [
159 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500160 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800161 ],
162
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700163 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900164 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000165 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700166 ":libgui_bufferqueue_sources",
167
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700168 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700169 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800170 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800171 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700172 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700173 "ConsumerBase.cpp",
174 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700175 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700176 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700177 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000178 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700179 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800180 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700181 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800182 "IGraphicBufferConsumer.cpp",
183 "IGraphicBufferProducer.cpp",
184 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800185 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700186 "ISurfaceComposer.cpp",
187 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700188 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800189 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800190 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700191 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800192 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700193 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800194 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700195 "Surface.cpp",
196 "SurfaceControl.cpp",
197 "SurfaceComposerClient.cpp",
198 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000199 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800200 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500201 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800202 "bufferqueue/1.0/B2HProducerListener.cpp",
203 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
204 "bufferqueue/2.0/B2HProducerListener.cpp",
205 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700206 ],
207
208 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800209 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700210 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700211 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800212 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700213 ],
214
Chong Zhang62493092020-01-15 16:04:47 -0800215 export_shared_lib_headers: [
216 "libbinder",
217 ],
218
Alec Mouricdedc5d2021-03-01 22:39:55 -0800219 export_header_lib_headers: [
220 "libgui_aidl_headers",
221 ],
222
Jiyong Parka75d3d62018-04-09 12:16:30 +0900223 // bufferhub is not used when building libgui for vendors
224 target: {
225 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800226 cflags: [
227 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800228 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900229 exclude_srcs: [
230 "BufferHubConsumer.cpp",
231 "BufferHubProducer.cpp",
232 ],
233 exclude_shared_libs: [
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700234 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900235 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800236 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900237 ],
238 },
239 },
240
Daichi Hironof474d3d2019-11-05 08:54:07 +0900241 aidl: {
242 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800243 },
244
Alec Mouricdedc5d2021-03-01 22:39:55 -0800245 header_libs: [
246 "libdvr_headers",
247 "libgui_aidl_headers",
248 "libpdx_headers",
249 ],
250
Yi Kong7cd72c52021-12-23 15:51:29 +0800251 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800252
253 lto: {
254 thin: true,
255 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700256}
257
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700258// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700259// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700260cc_library_static {
261 name: "libgui_bufferqueue_static",
262 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900263 apex_available: [
264 "//apex_available:platform",
265 "com.android.media.swcodec",
266 ],
267 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700268
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700269 cflags: [
270 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800271 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700272 ],
273
274 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700275
276 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000277 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700278 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800279 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700280 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700281}
282
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700283filegroup {
284 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700285 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700286 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700287 "BufferItem.cpp",
288 "BufferQueue.cpp",
289 "BufferQueueConsumer.cpp",
290 "BufferQueueCore.cpp",
291 "BufferQueueProducer.cpp",
292 "BufferQueueThreadState.cpp",
293 "BufferSlot.cpp",
294 "FrameTimestamps.cpp",
295 "GLConsumerUtils.cpp",
296 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700297 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700298 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700299 "bufferqueue/1.0/H2BProducerListener.cpp",
300 "bufferqueue/1.0/WProducerListener.cpp",
301 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700302 "bufferqueue/2.0/H2BProducerListener.cpp",
303 "bufferqueue/2.0/types.cpp",
304 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700305}
306
307// Common build config shared by libgui and libgui_bufferqueue_static.
308cc_defaults {
309 name: "libgui_bufferqueue-defaults",
310
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700311 cflags: [
312 "-Wall",
313 "-Werror",
314 ],
315
316 cppflags: [
317 "-Wextra",
318 "-DDEBUG_ONLY_CODE=0",
319 ],
320
321 product_variables: {
322 eng: {
323 cppflags: [
324 "-UDEBUG_ONLY_CODE",
325 "-DDEBUG_ONLY_CODE=1",
326 ],
327 },
328 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700329
David Stevens7347f0b2020-01-15 20:19:22 +0900330 whole_static_libs: [
331 "LibGuiProperties",
332 ],
333
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700334 shared_libs: [
335 "android.hardware.graphics.bufferqueue@1.0",
336 "android.hardware.graphics.bufferqueue@2.0",
337 "android.hardware.graphics.common@1.1",
338 "android.hardware.graphics.common@1.2",
339 "android.hidl.token@1.0-utils",
340 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700341 "libcutils",
342 "libEGL",
343 "libGLESv2",
344 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700345 "liblog",
346 "libnativewindow",
347 "libsync",
348 "libui",
349 "libutils",
350 "libvndksupport",
351 ],
352
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800353 static_libs: [
354 "libbinderthreadstateutils",
355 ],
356
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700357 header_libs: [
358 "libgui_headers",
359 "libnativebase_headers",
360 ],
361
Ady Abraham62f216c2020-10-13 19:07:23 -0700362 include_dirs: [
363 "frameworks/native/include",
364 ],
365
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700366 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700367 "libEGL",
368 "libnativewindow",
369 "libui",
370 "android.hardware.graphics.bufferqueue@1.0",
371 "android.hardware.graphics.bufferqueue@2.0",
372 "android.hardware.graphics.common@1.1",
373 "android.hardware.graphics.common@1.2",
374 "android.hidl.token@1.0-utils",
375 ],
376
377 export_header_lib_headers: [
378 "libgui_headers",
379 ],
380
381 export_include_dirs: [
382 "include",
383 ],
384}
385
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700386// GMocks for use by external code
387cc_library_static {
388 name: "libgui_mocks",
389 vendor_available: false,
390
391 defaults: ["libgui_bufferqueue-defaults"],
392 static_libs: [
393 "libgtest",
394 "libgmock",
395 ],
396
397 srcs: [
398 "mock/GraphicBufferConsumer.cpp",
399 "mock/GraphicBufferProducer.cpp",
400 ],
401}
402
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700403subdirs = ["tests"]