blob: 861cb6fba1b67017793f26c7ba54c4b508fda210 [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",
Ray Essickeed53a02022-02-09 09:40:20 -080040 // TODO(b/218719284) can media use be constrained to libgui_bufferqueue_static?
41 apex_available: [
42 "//apex_available:platform",
43 "com.android.media.swcodec",
44 "test_com.android.media.swcodec",
45 ],
Jiyong Park172bd722017-06-21 12:14:18 +090046}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070047
Alec Mouricdedc5d2021-03-01 22:39:55 -080048cc_library_headers {
49 name: "libgui_aidl_headers",
50 vendor_available: true,
51 static_libs: [
52 "libgui_aidl_static",
53 ],
54
55 export_static_lib_headers: [
56 "libgui_aidl_static",
57 ],
58}
59
chaviw3277faf2021-05-19 16:45:23 -050060// AIDL files that should be exposed to java
61filegroup {
62 name: "guiconstants_aidl",
63 srcs: [
Vishnu Nair9cf4a4d2021-09-17 12:16:08 -070064 "android/gui/DropInputMode.aidl",
chaviw3277faf2021-05-19 16:45:23 -050065 "android/**/TouchOcclusionMode.aidl",
66 ],
67}
68
69cc_library_static {
70 name: "libgui_window_info_static",
71 vendor_available: true,
72 host_supported: true,
73 srcs: [
74 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -080075 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070076 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050077 "android/gui/FocusRequest.aidl",
78 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050079 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050080 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050081 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070082 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050083 "WindowInfo.cpp",
84 ],
85
86 shared_libs: [
87 "libbinder",
88 ],
89
90 local_include_dirs: [
91 "include",
92 ],
93
94 export_shared_lib_headers: [
95 "libbinder",
96 ],
97
98 static_libs: [
99 "libui-types",
100 ],
101
102 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700103 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500104 },
105
106 include_dirs: [
107 "frameworks/native/include",
108 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100109
110 target: {
111 darwin: {
112 enabled: false,
113 },
114 },
chaviw3277faf2021-05-19 16:45:23 -0500115}
116
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000117filegroup {
118 name: "libgui_aidl",
119 srcs: ["aidl/**/*.aidl"],
120 path: "aidl/",
121}
122
Alec Mouricdedc5d2021-03-01 22:39:55 -0800123cc_library_static {
124 name: "libgui_aidl_static",
125 vendor_available: true,
126 srcs: [
127 ":libgui_aidl",
128 ],
129
130 shared_libs: [
131 "libbinder",
132 "libui",
133 ],
134
135 local_include_dirs: [
136 "include",
137 ],
138
139 export_shared_lib_headers: [
140 "libbinder",
141 ],
142
chaviw3277faf2021-05-19 16:45:23 -0500143 static_libs: [
144 "libui-types",
145 ],
146
Alec Mouricdedc5d2021-03-01 22:39:55 -0800147 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700148 export_aidl_headers: true,
149 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800150}
151
Vinay Verma86530662018-06-12 18:04:44 +0530152cc_defaults {
153 name: "libgui_defaults",
154
Jiyong Parka75d3d62018-04-09 12:16:30 +0900155 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700156
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700157 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700158
Alec Mouricdedc5d2021-03-01 22:39:55 -0800159 static_libs: [
160 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500161 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800162 ],
163 export_static_lib_headers: [
164 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500165 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800166 ],
167
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700168 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900169 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000170 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700171 ":libgui_bufferqueue_sources",
172
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700173 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700174 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800175 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800176 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700177 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "ConsumerBase.cpp",
179 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700180 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700181 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700182 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000183 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700184 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800185 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800186 "IGraphicBufferConsumer.cpp",
187 "IGraphicBufferProducer.cpp",
188 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700189 "ISurfaceComposer.cpp",
190 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700191 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800192 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800193 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700194 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800195 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700196 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800197 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700198 "Surface.cpp",
199 "SurfaceControl.cpp",
200 "SurfaceComposerClient.cpp",
201 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000202 "TransactionTracing.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800203 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800204 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500205 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800206 "bufferqueue/1.0/B2HProducerListener.cpp",
207 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
208 "bufferqueue/2.0/B2HProducerListener.cpp",
209 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700210 ],
211
212 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800213 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700214 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700215 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800216 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700217 ],
218
Chong Zhang62493092020-01-15 16:04:47 -0800219 export_shared_lib_headers: [
220 "libbinder",
221 ],
222
Alec Mouricdedc5d2021-03-01 22:39:55 -0800223 export_header_lib_headers: [
224 "libgui_aidl_headers",
225 ],
226
Jiyong Parka75d3d62018-04-09 12:16:30 +0900227 // bufferhub is not used when building libgui for vendors
228 target: {
229 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800230 cflags: [
231 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800232 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900233 exclude_srcs: [
234 "BufferHubConsumer.cpp",
235 "BufferHubProducer.cpp",
236 ],
237 exclude_shared_libs: [
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 Kong7cd72c52021-12-23 15:51:29 +0800255 afdo: true,
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",
Leon Scroggins IIIe7c51c62022-02-01 15:53:54 -0500344 "android.hardware.graphics.common-V3-ndk",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700345 "android.hidl.token@1.0-utils",
346 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700347 "libcutils",
348 "libEGL",
349 "libGLESv2",
350 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700351 "liblog",
352 "libnativewindow",
353 "libsync",
354 "libui",
355 "libutils",
356 "libvndksupport",
357 ],
358
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800359 static_libs: [
360 "libbinderthreadstateutils",
361 ],
362
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700363 header_libs: [
364 "libgui_headers",
365 "libnativebase_headers",
366 ],
367
Ady Abraham62f216c2020-10-13 19:07:23 -0700368 include_dirs: [
369 "frameworks/native/include",
370 ],
371
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700372 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700373 "libEGL",
374 "libnativewindow",
375 "libui",
376 "android.hardware.graphics.bufferqueue@1.0",
377 "android.hardware.graphics.bufferqueue@2.0",
378 "android.hardware.graphics.common@1.1",
379 "android.hardware.graphics.common@1.2",
380 "android.hidl.token@1.0-utils",
381 ],
382
383 export_header_lib_headers: [
384 "libgui_headers",
385 ],
386
387 export_include_dirs: [
388 "include",
389 ],
390}
391
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700392// GMocks for use by external code
393cc_library_static {
394 name: "libgui_mocks",
395 vendor_available: false,
396
397 defaults: ["libgui_bufferqueue-defaults"],
398 static_libs: [
399 "libgtest",
400 "libgmock",
401 ],
402
403 srcs: [
404 "mock/GraphicBufferConsumer.cpp",
405 "mock/GraphicBufferProducer.cpp",
406 ],
407}
408
Vinay Verma86530662018-06-12 18:04:44 +0530409cc_library_shared {
410 name: "libgui",
411 vendor_available: true,
412 vndk: {
413 enabled: true,
414 private: true,
415 },
416 defaults: ["libgui_defaults"]
417}
418
419cc_library_shared {
420 name: "libgui_vendor",
421 vendor: true,
422 defaults: ["libgui_defaults"]
423}
424
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700425subdirs = ["tests"]