blob: 8c359c77564b0345284684ed0e599b4a8968604f [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: [
Vishnu Nair9cf4a4d2021-09-17 12:16:08 -070058 "android/gui/DropInputMode.aidl",
chaviw3277faf2021-05-19 16:45:23 -050059 "android/**/TouchOcclusionMode.aidl",
60 ],
61}
62
63cc_library_static {
64 name: "libgui_window_info_static",
65 vendor_available: true,
66 host_supported: true,
67 srcs: [
68 ":guiconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070069 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050070 "android/gui/FocusRequest.aidl",
71 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050072 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050073 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050074 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070075 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050076 "WindowInfo.cpp",
77 ],
78
79 shared_libs: [
80 "libbinder",
81 ],
82
83 local_include_dirs: [
84 "include",
85 ],
86
87 export_shared_lib_headers: [
88 "libbinder",
89 ],
90
91 static_libs: [
92 "libui-types",
93 ],
94
95 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070096 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -050097 },
98
99 include_dirs: [
100 "frameworks/native/include",
101 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100102
103 target: {
104 darwin: {
105 enabled: false,
106 },
107 },
chaviw3277faf2021-05-19 16:45:23 -0500108}
109
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000110filegroup {
111 name: "libgui_aidl",
112 srcs: ["aidl/**/*.aidl"],
113 path: "aidl/",
114}
115
Alec Mouricdedc5d2021-03-01 22:39:55 -0800116cc_library_static {
117 name: "libgui_aidl_static",
118 vendor_available: true,
119 srcs: [
120 ":libgui_aidl",
121 ],
122
123 shared_libs: [
124 "libbinder",
125 "libui",
126 ],
127
128 local_include_dirs: [
129 "include",
130 ],
131
132 export_shared_lib_headers: [
133 "libbinder",
134 ],
135
chaviw3277faf2021-05-19 16:45:23 -0500136 static_libs: [
137 "libui-types",
138 ],
139
Alec Mouricdedc5d2021-03-01 22:39:55 -0800140 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700141 export_aidl_headers: true,
142 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800143}
144
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700145cc_library_shared {
146 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900147 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900148 vndk: {
149 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900150 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900151 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900152 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700153
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700154 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700155
Alec Mouricdedc5d2021-03-01 22:39:55 -0800156 static_libs: [
157 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500158 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800159 ],
160 export_static_lib_headers: [
161 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500162 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800163 ],
164
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700165 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900166 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000167 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700168 ":libgui_bufferqueue_sources",
169
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700170 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700171 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800172 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800173 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700174 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700175 "ConsumerBase.cpp",
176 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700177 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700178 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700179 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000180 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700181 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800182 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700183 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800184 "IGraphicBufferConsumer.cpp",
185 "IGraphicBufferProducer.cpp",
186 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800187 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700188 "ISurfaceComposer.cpp",
189 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700190 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800191 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800192 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700193 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800194 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700195 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800196 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700197 "Surface.cpp",
198 "SurfaceControl.cpp",
199 "SurfaceComposerClient.cpp",
200 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000201 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800202 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500203 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800204 "bufferqueue/1.0/B2HProducerListener.cpp",
205 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
206 "bufferqueue/2.0/B2HProducerListener.cpp",
207 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700208 ],
209
210 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800211 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800212 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700213 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700214 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800215 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700216 ],
217
Chong Zhang62493092020-01-15 16:04:47 -0800218 export_shared_lib_headers: [
219 "libbinder",
220 ],
221
Alec Mouricdedc5d2021-03-01 22:39:55 -0800222 export_header_lib_headers: [
223 "libgui_aidl_headers",
224 ],
225
Jiyong Parka75d3d62018-04-09 12:16:30 +0900226 // bufferhub is not used when building libgui for vendors
227 target: {
228 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800229 cflags: [
230 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800231 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900232 exclude_srcs: [
233 "BufferHubConsumer.cpp",
234 "BufferHubProducer.cpp",
235 ],
236 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800237 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700238 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900239 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800240 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900241 ],
242 },
243 },
244
Daichi Hironof474d3d2019-11-05 08:54:07 +0900245 aidl: {
246 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800247 },
248
Alec Mouricdedc5d2021-03-01 22:39:55 -0800249 header_libs: [
250 "libdvr_headers",
251 "libgui_aidl_headers",
252 "libpdx_headers",
253 ],
254
Yi Kongccc1c7c2021-02-22 17:44:17 +0800255 pgo: {
256 sampling: true,
257 profile_file: "libgui/libgui.profdata",
258 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800259
260 lto: {
261 thin: true,
262 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700263}
264
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700265// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700266// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700267cc_library_static {
268 name: "libgui_bufferqueue_static",
269 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900270 apex_available: [
271 "//apex_available:platform",
272 "com.android.media.swcodec",
273 ],
274 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700275
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700276 cflags: [
277 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800278 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700279 ],
280
281 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700282
283 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000284 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700285 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800286 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700287 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700288}
289
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700290filegroup {
291 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700292 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700293 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700294 "BufferItem.cpp",
295 "BufferQueue.cpp",
296 "BufferQueueConsumer.cpp",
297 "BufferQueueCore.cpp",
298 "BufferQueueProducer.cpp",
299 "BufferQueueThreadState.cpp",
300 "BufferSlot.cpp",
301 "FrameTimestamps.cpp",
302 "GLConsumerUtils.cpp",
303 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700304 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700305 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700306 "bufferqueue/1.0/H2BProducerListener.cpp",
307 "bufferqueue/1.0/WProducerListener.cpp",
308 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700309 "bufferqueue/2.0/H2BProducerListener.cpp",
310 "bufferqueue/2.0/types.cpp",
311 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700312}
313
314// Common build config shared by libgui and libgui_bufferqueue_static.
315cc_defaults {
316 name: "libgui_bufferqueue-defaults",
317
318 clang: true,
319 cflags: [
320 "-Wall",
321 "-Werror",
322 ],
323
324 cppflags: [
325 "-Wextra",
326 "-DDEBUG_ONLY_CODE=0",
327 ],
328
329 product_variables: {
330 eng: {
331 cppflags: [
332 "-UDEBUG_ONLY_CODE",
333 "-DDEBUG_ONLY_CODE=1",
334 ],
335 },
336 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700337
David Stevens7347f0b2020-01-15 20:19:22 +0900338 whole_static_libs: [
339 "LibGuiProperties",
340 ],
341
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700342 shared_libs: [
343 "android.hardware.graphics.bufferqueue@1.0",
344 "android.hardware.graphics.bufferqueue@2.0",
345 "android.hardware.graphics.common@1.1",
346 "android.hardware.graphics.common@1.2",
347 "android.hidl.token@1.0-utils",
348 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700349 "libcutils",
350 "libEGL",
351 "libGLESv2",
352 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700353 "liblog",
354 "libnativewindow",
355 "libsync",
356 "libui",
357 "libutils",
358 "libvndksupport",
359 ],
360
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800361 static_libs: [
362 "libbinderthreadstateutils",
363 ],
364
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700365 header_libs: [
366 "libgui_headers",
367 "libnativebase_headers",
368 ],
369
Ady Abraham62f216c2020-10-13 19:07:23 -0700370 include_dirs: [
371 "frameworks/native/include",
372 ],
373
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700374 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700375 "libEGL",
376 "libnativewindow",
377 "libui",
378 "android.hardware.graphics.bufferqueue@1.0",
379 "android.hardware.graphics.bufferqueue@2.0",
380 "android.hardware.graphics.common@1.1",
381 "android.hardware.graphics.common@1.2",
382 "android.hidl.token@1.0-utils",
383 ],
384
385 export_header_lib_headers: [
386 "libgui_headers",
387 ],
388
389 export_include_dirs: [
390 "include",
391 ],
392}
393
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700394// GMocks for use by external code
395cc_library_static {
396 name: "libgui_mocks",
397 vendor_available: false,
398
399 defaults: ["libgui_bufferqueue-defaults"],
400 static_libs: [
401 "libgtest",
402 "libgmock",
403 ],
404
405 srcs: [
406 "mock/GraphicBufferConsumer.cpp",
407 "mock/GraphicBufferProducer.cpp",
408 ],
409}
410
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700411subdirs = ["tests"]