blob: 2d8fff91da5ce6876dc92beca86a21090ac99261 [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: [
58 "android/**/TouchOcclusionMode.aidl",
59 ],
60}
61
62cc_library_static {
63 name: "libgui_window_info_static",
64 vendor_available: true,
65 host_supported: true,
66 srcs: [
67 ":guiconstants_aidl",
68 "android/gui/FocusRequest.aidl",
69 "android/gui/InputApplicationInfo.aidl",
70 "android/gui/WindowInfo.aidl",
71 "WindowInfo.cpp",
72 ],
73
74 shared_libs: [
75 "libbinder",
76 ],
77
78 local_include_dirs: [
79 "include",
80 ],
81
82 export_shared_lib_headers: [
83 "libbinder",
84 ],
85
86 static_libs: [
87 "libui-types",
88 ],
89
90 aidl: {
91 export_aidl_headers: true
92 },
93
94 include_dirs: [
95 "frameworks/native/include",
96 ],
97}
98
Pablo Gamito6ee484d2020-07-30 14:26:28 +000099filegroup {
100 name: "libgui_aidl",
101 srcs: ["aidl/**/*.aidl"],
102 path: "aidl/",
103}
104
Alec Mouricdedc5d2021-03-01 22:39:55 -0800105cc_library_static {
106 name: "libgui_aidl_static",
107 vendor_available: true,
108 srcs: [
109 ":libgui_aidl",
110 ],
111
112 shared_libs: [
113 "libbinder",
114 "libui",
115 ],
116
117 local_include_dirs: [
118 "include",
119 ],
120
121 export_shared_lib_headers: [
122 "libbinder",
123 ],
124
chaviw3277faf2021-05-19 16:45:23 -0500125 static_libs: [
126 "libui-types",
127 ],
128
Alec Mouricdedc5d2021-03-01 22:39:55 -0800129 aidl: {
130 export_aidl_headers: true
131 }
132}
133
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700134cc_library_shared {
135 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900136 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900137 vndk: {
138 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900139 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900140 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900141 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700142
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700143 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700144
Alec Mouricdedc5d2021-03-01 22:39:55 -0800145 static_libs: [
146 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500147 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800148 ],
149 export_static_lib_headers: [
150 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500151 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800152 ],
153
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700154 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900155 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000156 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700157 ":libgui_bufferqueue_sources",
158
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700159 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700160 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800161 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800162 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700163 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700164 "ConsumerBase.cpp",
165 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700166 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700167 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700168 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000169 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700170 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800171 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700172 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800173 "IGraphicBufferConsumer.cpp",
174 "IGraphicBufferProducer.cpp",
175 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800176 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700177 "ISurfaceComposer.cpp",
178 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700179 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800180 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800181 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700182 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800183 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700184 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800185 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700186 "Surface.cpp",
187 "SurfaceControl.cpp",
188 "SurfaceComposerClient.cpp",
189 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000190 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800191 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800192 "bufferqueue/1.0/B2HProducerListener.cpp",
193 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
194 "bufferqueue/2.0/B2HProducerListener.cpp",
195 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700196 ],
197
198 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800199 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800200 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700201 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700202 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800203 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700204 ],
205
Chong Zhang62493092020-01-15 16:04:47 -0800206 export_shared_lib_headers: [
207 "libbinder",
208 ],
209
Alec Mouricdedc5d2021-03-01 22:39:55 -0800210 export_header_lib_headers: [
211 "libgui_aidl_headers",
212 ],
213
Jiyong Parka75d3d62018-04-09 12:16:30 +0900214 // bufferhub is not used when building libgui for vendors
215 target: {
216 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800217 cflags: [
218 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800219 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900220 exclude_srcs: [
221 "BufferHubConsumer.cpp",
222 "BufferHubProducer.cpp",
223 ],
224 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800225 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700226 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900227 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800228 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900229 ],
230 },
231 },
232
Daichi Hironof474d3d2019-11-05 08:54:07 +0900233 aidl: {
234 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800235 },
236
Alec Mouricdedc5d2021-03-01 22:39:55 -0800237 header_libs: [
238 "libdvr_headers",
239 "libgui_aidl_headers",
240 "libpdx_headers",
241 ],
242
Yi Kongccc1c7c2021-02-22 17:44:17 +0800243 pgo: {
244 sampling: true,
245 profile_file: "libgui/libgui.profdata",
246 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800247
248 lto: {
249 thin: true,
250 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700251}
252
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700253// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700254// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700255cc_library_static {
256 name: "libgui_bufferqueue_static",
257 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900258 apex_available: [
259 "//apex_available:platform",
260 "com.android.media.swcodec",
261 ],
262 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700263
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700264 cflags: [
265 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800266 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700267 ],
268
269 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700270
271 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000272 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700273 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800274 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700275 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700276}
277
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700278filegroup {
279 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700280 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700281 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700282 "BufferItem.cpp",
283 "BufferQueue.cpp",
284 "BufferQueueConsumer.cpp",
285 "BufferQueueCore.cpp",
286 "BufferQueueProducer.cpp",
287 "BufferQueueThreadState.cpp",
288 "BufferSlot.cpp",
289 "FrameTimestamps.cpp",
290 "GLConsumerUtils.cpp",
291 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700292 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700293 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700294 "bufferqueue/1.0/H2BProducerListener.cpp",
295 "bufferqueue/1.0/WProducerListener.cpp",
296 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700297 "bufferqueue/2.0/H2BProducerListener.cpp",
298 "bufferqueue/2.0/types.cpp",
299 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700300}
301
302// Common build config shared by libgui and libgui_bufferqueue_static.
303cc_defaults {
304 name: "libgui_bufferqueue-defaults",
305
306 clang: true,
307 cflags: [
308 "-Wall",
309 "-Werror",
310 ],
311
312 cppflags: [
313 "-Wextra",
314 "-DDEBUG_ONLY_CODE=0",
315 ],
316
317 product_variables: {
318 eng: {
319 cppflags: [
320 "-UDEBUG_ONLY_CODE",
321 "-DDEBUG_ONLY_CODE=1",
322 ],
323 },
324 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700325
David Stevens7347f0b2020-01-15 20:19:22 +0900326 whole_static_libs: [
327 "LibGuiProperties",
328 ],
329
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700330 shared_libs: [
331 "android.hardware.graphics.bufferqueue@1.0",
332 "android.hardware.graphics.bufferqueue@2.0",
333 "android.hardware.graphics.common@1.1",
334 "android.hardware.graphics.common@1.2",
335 "android.hidl.token@1.0-utils",
336 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700337 "libcutils",
338 "libEGL",
339 "libGLESv2",
340 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700341 "liblog",
342 "libnativewindow",
343 "libsync",
344 "libui",
345 "libutils",
346 "libvndksupport",
347 ],
348
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800349 static_libs: [
350 "libbinderthreadstateutils",
351 ],
352
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700353 header_libs: [
354 "libgui_headers",
355 "libnativebase_headers",
356 ],
357
Ady Abraham62f216c2020-10-13 19:07:23 -0700358 include_dirs: [
359 "frameworks/native/include",
360 ],
361
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700362 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700363 "libEGL",
364 "libnativewindow",
365 "libui",
366 "android.hardware.graphics.bufferqueue@1.0",
367 "android.hardware.graphics.bufferqueue@2.0",
368 "android.hardware.graphics.common@1.1",
369 "android.hardware.graphics.common@1.2",
370 "android.hidl.token@1.0-utils",
371 ],
372
373 export_header_lib_headers: [
374 "libgui_headers",
375 ],
376
377 export_include_dirs: [
378 "include",
379 ],
380}
381
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700382// GMocks for use by external code
383cc_library_static {
384 name: "libgui_mocks",
385 vendor_available: false,
386
387 defaults: ["libgui_bufferqueue-defaults"],
388 static_libs: [
389 "libgtest",
390 "libgmock",
391 ],
392
393 srcs: [
394 "mock/GraphicBufferConsumer.cpp",
395 "mock/GraphicBufferProducer.cpp",
396 ],
397}
398
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700399subdirs = ["tests"]