blob: b0dc27fd20a894dff867a92dfa7e3b88817a88cd [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 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +010097
98 target: {
99 darwin: {
100 enabled: false,
101 },
102 },
chaviw3277faf2021-05-19 16:45:23 -0500103}
104
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000105filegroup {
106 name: "libgui_aidl",
107 srcs: ["aidl/**/*.aidl"],
108 path: "aidl/",
109}
110
Alec Mouricdedc5d2021-03-01 22:39:55 -0800111cc_library_static {
112 name: "libgui_aidl_static",
113 vendor_available: true,
114 srcs: [
115 ":libgui_aidl",
116 ],
117
118 shared_libs: [
119 "libbinder",
120 "libui",
121 ],
122
123 local_include_dirs: [
124 "include",
125 ],
126
127 export_shared_lib_headers: [
128 "libbinder",
129 ],
130
chaviw3277faf2021-05-19 16:45:23 -0500131 static_libs: [
132 "libui-types",
133 ],
134
Alec Mouricdedc5d2021-03-01 22:39:55 -0800135 aidl: {
136 export_aidl_headers: true
137 }
138}
139
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700140cc_library_shared {
141 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900142 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900143 vndk: {
144 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900145 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900146 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900147 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700148
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700149 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700150
Alec Mouricdedc5d2021-03-01 22:39:55 -0800151 static_libs: [
152 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500153 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800154 ],
155 export_static_lib_headers: [
156 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500157 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800158 ],
159
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700160 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900161 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000162 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700163 ":libgui_bufferqueue_sources",
164
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700165 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700166 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800167 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800168 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700169 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700170 "ConsumerBase.cpp",
171 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700172 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700173 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700174 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000175 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700176 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800177 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800179 "IGraphicBufferConsumer.cpp",
180 "IGraphicBufferProducer.cpp",
181 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800182 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700183 "ISurfaceComposer.cpp",
184 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700185 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800186 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800187 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700188 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800189 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700190 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800191 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192 "Surface.cpp",
193 "SurfaceControl.cpp",
194 "SurfaceComposerClient.cpp",
195 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000196 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800197 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800198 "bufferqueue/1.0/B2HProducerListener.cpp",
199 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
200 "bufferqueue/2.0/B2HProducerListener.cpp",
201 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700202 ],
203
204 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800205 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800206 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700207 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700208 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800209 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700210 ],
211
Chong Zhang62493092020-01-15 16:04:47 -0800212 export_shared_lib_headers: [
213 "libbinder",
214 ],
215
Alec Mouricdedc5d2021-03-01 22:39:55 -0800216 export_header_lib_headers: [
217 "libgui_aidl_headers",
218 ],
219
Jiyong Parka75d3d62018-04-09 12:16:30 +0900220 // bufferhub is not used when building libgui for vendors
221 target: {
222 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800223 cflags: [
224 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800225 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900226 exclude_srcs: [
227 "BufferHubConsumer.cpp",
228 "BufferHubProducer.cpp",
229 ],
230 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800231 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700232 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900233 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800234 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900235 ],
236 },
237 },
238
Daichi Hironof474d3d2019-11-05 08:54:07 +0900239 aidl: {
240 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800241 },
242
Alec Mouricdedc5d2021-03-01 22:39:55 -0800243 header_libs: [
244 "libdvr_headers",
245 "libgui_aidl_headers",
246 "libpdx_headers",
247 ],
248
Yi Kongccc1c7c2021-02-22 17:44:17 +0800249 pgo: {
250 sampling: true,
251 profile_file: "libgui/libgui.profdata",
252 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800253
254 lto: {
255 thin: true,
256 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700257}
258
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700259// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700260// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700261cc_library_static {
262 name: "libgui_bufferqueue_static",
263 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900264 apex_available: [
265 "//apex_available:platform",
266 "com.android.media.swcodec",
267 ],
268 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700269
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700270 cflags: [
271 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800272 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700273 ],
274
275 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700276
277 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000278 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700279 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800280 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700281 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700282}
283
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700284filegroup {
285 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700286 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700287 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700288 "BufferItem.cpp",
289 "BufferQueue.cpp",
290 "BufferQueueConsumer.cpp",
291 "BufferQueueCore.cpp",
292 "BufferQueueProducer.cpp",
293 "BufferQueueThreadState.cpp",
294 "BufferSlot.cpp",
295 "FrameTimestamps.cpp",
296 "GLConsumerUtils.cpp",
297 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700298 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700299 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700300 "bufferqueue/1.0/H2BProducerListener.cpp",
301 "bufferqueue/1.0/WProducerListener.cpp",
302 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700303 "bufferqueue/2.0/H2BProducerListener.cpp",
304 "bufferqueue/2.0/types.cpp",
305 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700306}
307
308// Common build config shared by libgui and libgui_bufferqueue_static.
309cc_defaults {
310 name: "libgui_bufferqueue-defaults",
311
312 clang: true,
313 cflags: [
314 "-Wall",
315 "-Werror",
316 ],
317
318 cppflags: [
319 "-Wextra",
320 "-DDEBUG_ONLY_CODE=0",
321 ],
322
323 product_variables: {
324 eng: {
325 cppflags: [
326 "-UDEBUG_ONLY_CODE",
327 "-DDEBUG_ONLY_CODE=1",
328 ],
329 },
330 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700331
David Stevens7347f0b2020-01-15 20:19:22 +0900332 whole_static_libs: [
333 "LibGuiProperties",
334 ],
335
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700336 shared_libs: [
337 "android.hardware.graphics.bufferqueue@1.0",
338 "android.hardware.graphics.bufferqueue@2.0",
339 "android.hardware.graphics.common@1.1",
340 "android.hardware.graphics.common@1.2",
341 "android.hidl.token@1.0-utils",
342 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700343 "libcutils",
344 "libEGL",
345 "libGLESv2",
346 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700347 "liblog",
348 "libnativewindow",
349 "libsync",
350 "libui",
351 "libutils",
352 "libvndksupport",
353 ],
354
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800355 static_libs: [
356 "libbinderthreadstateutils",
357 ],
358
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700359 header_libs: [
360 "libgui_headers",
361 "libnativebase_headers",
362 ],
363
Ady Abraham62f216c2020-10-13 19:07:23 -0700364 include_dirs: [
365 "frameworks/native/include",
366 ],
367
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700368 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700369 "libEGL",
370 "libnativewindow",
371 "libui",
372 "android.hardware.graphics.bufferqueue@1.0",
373 "android.hardware.graphics.bufferqueue@2.0",
374 "android.hardware.graphics.common@1.1",
375 "android.hardware.graphics.common@1.2",
376 "android.hidl.token@1.0-utils",
377 ],
378
379 export_header_lib_headers: [
380 "libgui_headers",
381 ],
382
383 export_include_dirs: [
384 "include",
385 ],
386}
387
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700388// GMocks for use by external code
389cc_library_static {
390 name: "libgui_mocks",
391 vendor_available: false,
392
393 defaults: ["libgui_bufferqueue-defaults"],
394 static_libs: [
395 "libgtest",
396 "libgmock",
397 ],
398
399 srcs: [
400 "mock/GraphicBufferConsumer.cpp",
401 "mock/GraphicBufferProducer.cpp",
402 ],
403}
404
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700405subdirs = ["tests"]