blob: 5cf7a5fe532cf6c142a3b181c700899b9071ee1b [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",
chaviw3277faf2021-05-19 16:45:23 -050071 "android/gui/WindowInfo.aidl",
72 "WindowInfo.cpp",
73 ],
74
75 shared_libs: [
76 "libbinder",
77 ],
78
79 local_include_dirs: [
80 "include",
81 ],
82
83 export_shared_lib_headers: [
84 "libbinder",
85 ],
86
87 static_libs: [
88 "libui-types",
89 ],
90
91 aidl: {
92 export_aidl_headers: true
93 },
94
95 include_dirs: [
96 "frameworks/native/include",
97 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +010098
99 target: {
100 darwin: {
101 enabled: false,
102 },
103 },
chaviw3277faf2021-05-19 16:45:23 -0500104}
105
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000106filegroup {
107 name: "libgui_aidl",
108 srcs: ["aidl/**/*.aidl"],
109 path: "aidl/",
110}
111
Alec Mouricdedc5d2021-03-01 22:39:55 -0800112cc_library_static {
113 name: "libgui_aidl_static",
114 vendor_available: true,
115 srcs: [
116 ":libgui_aidl",
117 ],
118
119 shared_libs: [
120 "libbinder",
121 "libui",
122 ],
123
124 local_include_dirs: [
125 "include",
126 ],
127
128 export_shared_lib_headers: [
129 "libbinder",
130 ],
131
chaviw3277faf2021-05-19 16:45:23 -0500132 static_libs: [
133 "libui-types",
134 ],
135
Alec Mouricdedc5d2021-03-01 22:39:55 -0800136 aidl: {
137 export_aidl_headers: true
138 }
139}
140
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700141cc_library_shared {
142 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900143 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900144 vndk: {
145 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900146 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900147 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900148 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700149
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700150 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700151
Alec Mouricdedc5d2021-03-01 22:39:55 -0800152 static_libs: [
153 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500154 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800155 ],
156 export_static_lib_headers: [
157 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500158 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800159 ],
160
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700161 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900162 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000163 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700164 ":libgui_bufferqueue_sources",
165
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700166 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700167 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800168 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800169 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700170 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700171 "ConsumerBase.cpp",
172 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700173 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700174 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700175 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000176 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700177 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800178 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700179 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800180 "IGraphicBufferConsumer.cpp",
181 "IGraphicBufferProducer.cpp",
182 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800183 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700184 "ISurfaceComposer.cpp",
185 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700186 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800187 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800188 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700189 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800190 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700191 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800192 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700193 "Surface.cpp",
194 "SurfaceControl.cpp",
195 "SurfaceComposerClient.cpp",
196 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000197 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800198 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500199 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800200 "bufferqueue/1.0/B2HProducerListener.cpp",
201 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
202 "bufferqueue/2.0/B2HProducerListener.cpp",
203 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700204 ],
205
206 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800207 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800208 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700209 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700210 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800211 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700212 ],
213
Chong Zhang62493092020-01-15 16:04:47 -0800214 export_shared_lib_headers: [
215 "libbinder",
216 ],
217
Alec Mouricdedc5d2021-03-01 22:39:55 -0800218 export_header_lib_headers: [
219 "libgui_aidl_headers",
220 ],
221
Jiyong Parka75d3d62018-04-09 12:16:30 +0900222 // bufferhub is not used when building libgui for vendors
223 target: {
224 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800225 cflags: [
226 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800227 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900228 exclude_srcs: [
229 "BufferHubConsumer.cpp",
230 "BufferHubProducer.cpp",
231 ],
232 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800233 "android.frameworks.bufferhub@1.0",
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 Kongccc1c7c2021-02-22 17:44:17 +0800251 pgo: {
252 sampling: true,
253 profile_file: "libgui/libgui.profdata",
254 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800255
256 lto: {
257 thin: true,
258 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700259}
260
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700261// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700262// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700263cc_library_static {
264 name: "libgui_bufferqueue_static",
265 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900266 apex_available: [
267 "//apex_available:platform",
268 "com.android.media.swcodec",
269 ],
270 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700271
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700272 cflags: [
273 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800274 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700275 ],
276
277 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700278
279 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000280 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700281 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800282 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700283 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700284}
285
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700286filegroup {
287 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700288 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700289 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700290 "BufferItem.cpp",
291 "BufferQueue.cpp",
292 "BufferQueueConsumer.cpp",
293 "BufferQueueCore.cpp",
294 "BufferQueueProducer.cpp",
295 "BufferQueueThreadState.cpp",
296 "BufferSlot.cpp",
297 "FrameTimestamps.cpp",
298 "GLConsumerUtils.cpp",
299 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700300 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700301 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700302 "bufferqueue/1.0/H2BProducerListener.cpp",
303 "bufferqueue/1.0/WProducerListener.cpp",
304 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700305 "bufferqueue/2.0/H2BProducerListener.cpp",
306 "bufferqueue/2.0/types.cpp",
307 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700308}
309
310// Common build config shared by libgui and libgui_bufferqueue_static.
311cc_defaults {
312 name: "libgui_bufferqueue-defaults",
313
314 clang: true,
315 cflags: [
316 "-Wall",
317 "-Werror",
318 ],
319
320 cppflags: [
321 "-Wextra",
322 "-DDEBUG_ONLY_CODE=0",
323 ],
324
325 product_variables: {
326 eng: {
327 cppflags: [
328 "-UDEBUG_ONLY_CODE",
329 "-DDEBUG_ONLY_CODE=1",
330 ],
331 },
332 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700333
David Stevens7347f0b2020-01-15 20:19:22 +0900334 whole_static_libs: [
335 "LibGuiProperties",
336 ],
337
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700338 shared_libs: [
339 "android.hardware.graphics.bufferqueue@1.0",
340 "android.hardware.graphics.bufferqueue@2.0",
341 "android.hardware.graphics.common@1.1",
342 "android.hardware.graphics.common@1.2",
343 "android.hidl.token@1.0-utils",
344 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700345 "libcutils",
346 "libEGL",
347 "libGLESv2",
348 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700349 "liblog",
350 "libnativewindow",
351 "libsync",
352 "libui",
353 "libutils",
354 "libvndksupport",
355 ],
356
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800357 static_libs: [
358 "libbinderthreadstateutils",
359 ],
360
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700361 header_libs: [
362 "libgui_headers",
363 "libnativebase_headers",
364 ],
365
Ady Abraham62f216c2020-10-13 19:07:23 -0700366 include_dirs: [
367 "frameworks/native/include",
368 ],
369
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700370 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700371 "libEGL",
372 "libnativewindow",
373 "libui",
374 "android.hardware.graphics.bufferqueue@1.0",
375 "android.hardware.graphics.bufferqueue@2.0",
376 "android.hardware.graphics.common@1.1",
377 "android.hardware.graphics.common@1.2",
378 "android.hidl.token@1.0-utils",
379 ],
380
381 export_header_lib_headers: [
382 "libgui_headers",
383 ],
384
385 export_include_dirs: [
386 "include",
387 ],
388}
389
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700390// GMocks for use by external code
391cc_library_static {
392 name: "libgui_mocks",
393 vendor_available: false,
394
395 defaults: ["libgui_bufferqueue-defaults"],
396 static_libs: [
397 "libgtest",
398 "libgmock",
399 ],
400
401 srcs: [
402 "mock/GraphicBufferConsumer.cpp",
403 "mock/GraphicBufferProducer.cpp",
404 ],
405}
406
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700407subdirs = ["tests"]