blob: 326da3a7b53d78afc8215ce50d86b3cbcc80bc08 [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",
chaviw60c9d3e2021-06-04 12:52:17 -050070 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050071 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050072 "android/gui/WindowInfo.aidl",
73 "WindowInfo.cpp",
74 ],
75
76 shared_libs: [
77 "libbinder",
78 ],
79
80 local_include_dirs: [
81 "include",
82 ],
83
84 export_shared_lib_headers: [
85 "libbinder",
86 ],
87
88 static_libs: [
89 "libui-types",
90 ],
91
92 aidl: {
93 export_aidl_headers: true
94 },
95
96 include_dirs: [
97 "frameworks/native/include",
98 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +010099
100 target: {
101 darwin: {
102 enabled: false,
103 },
104 },
chaviw3277faf2021-05-19 16:45:23 -0500105}
106
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000107filegroup {
108 name: "libgui_aidl",
109 srcs: ["aidl/**/*.aidl"],
110 path: "aidl/",
111}
112
Alec Mouricdedc5d2021-03-01 22:39:55 -0800113cc_library_static {
114 name: "libgui_aidl_static",
115 vendor_available: true,
116 srcs: [
117 ":libgui_aidl",
118 ],
119
120 shared_libs: [
121 "libbinder",
122 "libui",
123 ],
124
125 local_include_dirs: [
126 "include",
127 ],
128
129 export_shared_lib_headers: [
130 "libbinder",
131 ],
132
chaviw3277faf2021-05-19 16:45:23 -0500133 static_libs: [
134 "libui-types",
135 ],
136
Alec Mouricdedc5d2021-03-01 22:39:55 -0800137 aidl: {
138 export_aidl_headers: true
139 }
140}
141
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700142cc_library_shared {
143 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900144 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900145 vndk: {
146 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900147 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900148 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900149 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700150
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700151 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700152
Alec Mouricdedc5d2021-03-01 22:39:55 -0800153 static_libs: [
154 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500155 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800156 ],
157 export_static_lib_headers: [
158 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500159 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800160 ],
161
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700162 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900163 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000164 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700165 ":libgui_bufferqueue_sources",
166
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700167 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700168 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800169 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800170 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700171 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700172 "ConsumerBase.cpp",
173 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700174 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700175 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700176 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000177 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800179 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700180 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800181 "IGraphicBufferConsumer.cpp",
182 "IGraphicBufferProducer.cpp",
183 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800184 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700185 "ISurfaceComposer.cpp",
186 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700187 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800188 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800189 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700190 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800191 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800193 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700194 "Surface.cpp",
195 "SurfaceControl.cpp",
196 "SurfaceComposerClient.cpp",
197 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000198 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800199 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500200 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800201 "bufferqueue/1.0/B2HProducerListener.cpp",
202 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
203 "bufferqueue/2.0/B2HProducerListener.cpp",
204 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700205 ],
206
207 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800208 "android.frameworks.bufferhub@1.0",
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: [
Fan Xu021776e2018-12-05 13:34:48 -0800234 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700235 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900236 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800237 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900238 ],
239 },
240 },
241
Daichi Hironof474d3d2019-11-05 08:54:07 +0900242 aidl: {
243 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800244 },
245
Alec Mouricdedc5d2021-03-01 22:39:55 -0800246 header_libs: [
247 "libdvr_headers",
248 "libgui_aidl_headers",
249 "libpdx_headers",
250 ],
251
Yi Kongccc1c7c2021-02-22 17:44:17 +0800252 pgo: {
253 sampling: true,
254 profile_file: "libgui/libgui.profdata",
255 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800256
257 lto: {
258 thin: true,
259 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700260}
261
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700262// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700263// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700264cc_library_static {
265 name: "libgui_bufferqueue_static",
266 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900267 apex_available: [
268 "//apex_available:platform",
269 "com.android.media.swcodec",
270 ],
271 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700272
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700273 cflags: [
274 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800275 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700276 ],
277
278 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700279
280 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000281 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700282 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800283 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700284 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700285}
286
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700287filegroup {
288 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700289 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700290 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700291 "BufferItem.cpp",
292 "BufferQueue.cpp",
293 "BufferQueueConsumer.cpp",
294 "BufferQueueCore.cpp",
295 "BufferQueueProducer.cpp",
296 "BufferQueueThreadState.cpp",
297 "BufferSlot.cpp",
298 "FrameTimestamps.cpp",
299 "GLConsumerUtils.cpp",
300 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700301 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700302 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700303 "bufferqueue/1.0/H2BProducerListener.cpp",
304 "bufferqueue/1.0/WProducerListener.cpp",
305 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700306 "bufferqueue/2.0/H2BProducerListener.cpp",
307 "bufferqueue/2.0/types.cpp",
308 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700309}
310
311// Common build config shared by libgui and libgui_bufferqueue_static.
312cc_defaults {
313 name: "libgui_bufferqueue-defaults",
314
315 clang: true,
316 cflags: [
317 "-Wall",
318 "-Werror",
319 ],
320
321 cppflags: [
322 "-Wextra",
323 "-DDEBUG_ONLY_CODE=0",
324 ],
325
326 product_variables: {
327 eng: {
328 cppflags: [
329 "-UDEBUG_ONLY_CODE",
330 "-DDEBUG_ONLY_CODE=1",
331 ],
332 },
333 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700334
David Stevens7347f0b2020-01-15 20:19:22 +0900335 whole_static_libs: [
336 "LibGuiProperties",
337 ],
338
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700339 shared_libs: [
340 "android.hardware.graphics.bufferqueue@1.0",
341 "android.hardware.graphics.bufferqueue@2.0",
342 "android.hardware.graphics.common@1.1",
343 "android.hardware.graphics.common@1.2",
344 "android.hidl.token@1.0-utils",
345 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700346 "libcutils",
347 "libEGL",
348 "libGLESv2",
349 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700350 "liblog",
351 "libnativewindow",
352 "libsync",
353 "libui",
354 "libutils",
355 "libvndksupport",
356 ],
357
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800358 static_libs: [
359 "libbinderthreadstateutils",
360 ],
361
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700362 header_libs: [
363 "libgui_headers",
364 "libnativebase_headers",
365 ],
366
Ady Abraham62f216c2020-10-13 19:07:23 -0700367 include_dirs: [
368 "frameworks/native/include",
369 ],
370
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700371 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700372 "libEGL",
373 "libnativewindow",
374 "libui",
375 "android.hardware.graphics.bufferqueue@1.0",
376 "android.hardware.graphics.bufferqueue@2.0",
377 "android.hardware.graphics.common@1.1",
378 "android.hardware.graphics.common@1.2",
379 "android.hidl.token@1.0-utils",
380 ],
381
382 export_header_lib_headers: [
383 "libgui_headers",
384 ],
385
386 export_include_dirs: [
387 "include",
388 ],
389}
390
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700391// GMocks for use by external code
392cc_library_static {
393 name: "libgui_mocks",
394 vendor_available: false,
395
396 defaults: ["libgui_bufferqueue-defaults"],
397 static_libs: [
398 "libgtest",
399 "libgmock",
400 ],
401
402 srcs: [
403 "mock/GraphicBufferConsumer.cpp",
404 "mock/GraphicBufferProducer.cpp",
405 ],
406}
407
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700408subdirs = ["tests"]