blob: 2d1f5a169430382bc0422388be0977d081f1764f [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",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070068 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050069 "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",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070074 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050075 "WindowInfo.cpp",
76 ],
77
78 shared_libs: [
79 "libbinder",
80 ],
81
82 local_include_dirs: [
83 "include",
84 ],
85
86 export_shared_lib_headers: [
87 "libbinder",
88 ],
89
90 static_libs: [
91 "libui-types",
92 ],
93
94 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070095 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -050096 },
97
98 include_dirs: [
99 "frameworks/native/include",
100 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100101
102 target: {
103 darwin: {
104 enabled: false,
105 },
106 },
chaviw3277faf2021-05-19 16:45:23 -0500107}
108
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000109filegroup {
110 name: "libgui_aidl",
111 srcs: ["aidl/**/*.aidl"],
112 path: "aidl/",
113}
114
Alec Mouricdedc5d2021-03-01 22:39:55 -0800115cc_library_static {
116 name: "libgui_aidl_static",
117 vendor_available: true,
118 srcs: [
119 ":libgui_aidl",
120 ],
121
122 shared_libs: [
123 "libbinder",
124 "libui",
125 ],
126
127 local_include_dirs: [
128 "include",
129 ],
130
131 export_shared_lib_headers: [
132 "libbinder",
133 ],
134
chaviw3277faf2021-05-19 16:45:23 -0500135 static_libs: [
136 "libui-types",
137 ],
138
Alec Mouricdedc5d2021-03-01 22:39:55 -0800139 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700140 export_aidl_headers: true,
141 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800142}
143
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700144cc_library_shared {
145 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900146 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900147 vndk: {
148 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900149 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900150 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900151 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700152
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700153 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700154
Alec Mouricdedc5d2021-03-01 22:39:55 -0800155 static_libs: [
156 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500157 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800158 ],
159 export_static_lib_headers: [
160 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500161 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800162 ],
163
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700164 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900165 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000166 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700167 ":libgui_bufferqueue_sources",
168
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700169 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700170 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800171 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800172 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700173 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700174 "ConsumerBase.cpp",
175 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700176 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700177 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000179 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700180 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800181 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700182 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800183 "IGraphicBufferConsumer.cpp",
184 "IGraphicBufferProducer.cpp",
185 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800186 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700187 "ISurfaceComposer.cpp",
188 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700189 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800190 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800191 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800193 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700194 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800195 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700196 "Surface.cpp",
197 "SurfaceControl.cpp",
198 "SurfaceComposerClient.cpp",
199 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000200 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800201 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500202 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800203 "bufferqueue/1.0/B2HProducerListener.cpp",
204 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
205 "bufferqueue/2.0/B2HProducerListener.cpp",
206 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700207 ],
208
209 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800210 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800211 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700212 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700213 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800214 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700215 ],
216
Chong Zhang62493092020-01-15 16:04:47 -0800217 export_shared_lib_headers: [
218 "libbinder",
219 ],
220
Alec Mouricdedc5d2021-03-01 22:39:55 -0800221 export_header_lib_headers: [
222 "libgui_aidl_headers",
223 ],
224
Jiyong Parka75d3d62018-04-09 12:16:30 +0900225 // bufferhub is not used when building libgui for vendors
226 target: {
227 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800228 cflags: [
229 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800230 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900231 exclude_srcs: [
232 "BufferHubConsumer.cpp",
233 "BufferHubProducer.cpp",
234 ],
235 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800236 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700237 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900238 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800239 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900240 ],
241 },
242 },
243
Daichi Hironof474d3d2019-11-05 08:54:07 +0900244 aidl: {
245 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800246 },
247
Alec Mouricdedc5d2021-03-01 22:39:55 -0800248 header_libs: [
249 "libdvr_headers",
250 "libgui_aidl_headers",
251 "libpdx_headers",
252 ],
253
Yi Kongccc1c7c2021-02-22 17:44:17 +0800254 pgo: {
255 sampling: true,
256 profile_file: "libgui/libgui.profdata",
257 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800258
259 lto: {
260 thin: true,
261 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700262}
263
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700264// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700265// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700266cc_library_static {
267 name: "libgui_bufferqueue_static",
268 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900269 apex_available: [
270 "//apex_available:platform",
271 "com.android.media.swcodec",
272 ],
273 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700274
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700275 cflags: [
276 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800277 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700278 ],
279
280 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700281
282 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000283 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700284 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800285 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700286 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700287}
288
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700289filegroup {
290 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700291 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700292 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700293 "BufferItem.cpp",
294 "BufferQueue.cpp",
295 "BufferQueueConsumer.cpp",
296 "BufferQueueCore.cpp",
297 "BufferQueueProducer.cpp",
298 "BufferQueueThreadState.cpp",
299 "BufferSlot.cpp",
300 "FrameTimestamps.cpp",
301 "GLConsumerUtils.cpp",
302 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700303 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700304 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700305 "bufferqueue/1.0/H2BProducerListener.cpp",
306 "bufferqueue/1.0/WProducerListener.cpp",
307 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700308 "bufferqueue/2.0/H2BProducerListener.cpp",
309 "bufferqueue/2.0/types.cpp",
310 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700311}
312
313// Common build config shared by libgui and libgui_bufferqueue_static.
314cc_defaults {
315 name: "libgui_bufferqueue-defaults",
316
317 clang: true,
318 cflags: [
319 "-Wall",
320 "-Werror",
321 ],
322
323 cppflags: [
324 "-Wextra",
325 "-DDEBUG_ONLY_CODE=0",
326 ],
327
328 product_variables: {
329 eng: {
330 cppflags: [
331 "-UDEBUG_ONLY_CODE",
332 "-DDEBUG_ONLY_CODE=1",
333 ],
334 },
335 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700336
David Stevens7347f0b2020-01-15 20:19:22 +0900337 whole_static_libs: [
338 "LibGuiProperties",
339 ],
340
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700341 shared_libs: [
342 "android.hardware.graphics.bufferqueue@1.0",
343 "android.hardware.graphics.bufferqueue@2.0",
344 "android.hardware.graphics.common@1.1",
345 "android.hardware.graphics.common@1.2",
346 "android.hidl.token@1.0-utils",
347 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700348 "libcutils",
349 "libEGL",
350 "libGLESv2",
351 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700352 "liblog",
353 "libnativewindow",
354 "libsync",
355 "libui",
356 "libutils",
357 "libvndksupport",
358 ],
359
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800360 static_libs: [
361 "libbinderthreadstateutils",
362 ],
363
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700364 header_libs: [
365 "libgui_headers",
366 "libnativebase_headers",
367 ],
368
Ady Abraham62f216c2020-10-13 19:07:23 -0700369 include_dirs: [
370 "frameworks/native/include",
371 ],
372
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700373 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700374 "libEGL",
375 "libnativewindow",
376 "libui",
377 "android.hardware.graphics.bufferqueue@1.0",
378 "android.hardware.graphics.bufferqueue@2.0",
379 "android.hardware.graphics.common@1.1",
380 "android.hardware.graphics.common@1.2",
381 "android.hidl.token@1.0-utils",
382 ],
383
384 export_header_lib_headers: [
385 "libgui_headers",
386 ],
387
388 export_include_dirs: [
389 "include",
390 ],
391}
392
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700393// GMocks for use by external code
394cc_library_static {
395 name: "libgui_mocks",
396 vendor_available: false,
397
398 defaults: ["libgui_bufferqueue-defaults"],
399 static_libs: [
400 "libgtest",
401 "libgmock",
402 ],
403
404 srcs: [
405 "mock/GraphicBufferConsumer.cpp",
406 "mock/GraphicBufferProducer.cpp",
407 ],
408}
409
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700410subdirs = ["tests"]