blob: 319003800c5ce037f602325baec5123f0cadb96b [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
Pablo Gamito6ee484d2020-07-30 14:26:28 +000054filegroup {
55 name: "libgui_aidl",
56 srcs: ["aidl/**/*.aidl"],
57 path: "aidl/",
58}
59
Alec Mouricdedc5d2021-03-01 22:39:55 -080060cc_library_static {
61 name: "libgui_aidl_static",
62 vendor_available: true,
63 srcs: [
64 ":libgui_aidl",
65 ],
66
67 shared_libs: [
68 "libbinder",
69 "libui",
70 ],
71
72 local_include_dirs: [
73 "include",
74 ],
75
76 export_shared_lib_headers: [
77 "libbinder",
78 ],
79
80 aidl: {
81 export_aidl_headers: true
82 }
83}
84
85
Dan Willemsen3106c1c2016-10-03 23:56:51 -070086cc_library_shared {
87 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +090088 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090089 vndk: {
90 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +090091 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090092 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090093 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070094
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070095 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070096
Alec Mouricdedc5d2021-03-01 22:39:55 -080097 static_libs: [
98 "libgui_aidl_static",
99 ],
100 export_static_lib_headers: [
101 "libgui_aidl_static",
102 ],
103
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700104 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900105 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000106 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700107 ":libgui_bufferqueue_sources",
108
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700109 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700110 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800111 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800112 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700113 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700114 "ConsumerBase.cpp",
115 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700116 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700117 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700118 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000119 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700120 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800121 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700122 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800123 "IGraphicBufferConsumer.cpp",
124 "IGraphicBufferProducer.cpp",
125 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800126 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700127 "ISurfaceComposer.cpp",
128 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700129 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800130 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800131 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700132 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800133 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700134 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800135 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700136 "Surface.cpp",
137 "SurfaceControl.cpp",
138 "SurfaceComposerClient.cpp",
139 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000140 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800141 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800142 "bufferqueue/1.0/B2HProducerListener.cpp",
143 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
144 "bufferqueue/2.0/B2HProducerListener.cpp",
145 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700146 ],
147
148 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800149 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700150 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700151 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800152 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800153 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700154 ],
155
Chong Zhang62493092020-01-15 16:04:47 -0800156 export_shared_lib_headers: [
157 "libbinder",
Vishnu Naire798b472020-07-23 13:52:21 -0700158 "libinput",
Chong Zhang62493092020-01-15 16:04:47 -0800159 ],
160
Alec Mouricdedc5d2021-03-01 22:39:55 -0800161 export_header_lib_headers: [
162 "libgui_aidl_headers",
163 ],
164
Jiyong Parka75d3d62018-04-09 12:16:30 +0900165 // bufferhub is not used when building libgui for vendors
166 target: {
167 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800168 cflags: [
169 "-DNO_BUFFERHUB",
170 "-DNO_INPUT",
171 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900172 exclude_srcs: [
173 "BufferHubConsumer.cpp",
174 "BufferHubProducer.cpp",
175 ],
176 exclude_shared_libs: [
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700177 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900178 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800179 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800180 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900181 ],
182 },
183 },
184
Daichi Hironof474d3d2019-11-05 08:54:07 +0900185 aidl: {
186 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800187 },
188
Alec Mouricdedc5d2021-03-01 22:39:55 -0800189 header_libs: [
190 "libdvr_headers",
191 "libgui_aidl_headers",
192 "libpdx_headers",
193 ],
194
Yi Kongccc1c7c2021-02-22 17:44:17 +0800195 pgo: {
196 sampling: true,
197 profile_file: "libgui/libgui.profdata",
198 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800199
200 lto: {
201 thin: true,
202 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700203}
204
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700205// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700206// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700207cc_library_static {
208 name: "libgui_bufferqueue_static",
209 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900210 apex_available: [
211 "//apex_available:platform",
212 "com.android.media.swcodec",
213 ],
214 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700215
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700216 cflags: [
217 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800218 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700219 ],
220
221 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700222
223 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000224 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700225 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800226 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700227 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700228}
229
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700230filegroup {
231 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700232 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700233 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700234 "BufferItem.cpp",
235 "BufferQueue.cpp",
236 "BufferQueueConsumer.cpp",
237 "BufferQueueCore.cpp",
238 "BufferQueueProducer.cpp",
239 "BufferQueueThreadState.cpp",
240 "BufferSlot.cpp",
241 "FrameTimestamps.cpp",
242 "GLConsumerUtils.cpp",
243 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700244 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700245 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700246 "bufferqueue/1.0/H2BProducerListener.cpp",
247 "bufferqueue/1.0/WProducerListener.cpp",
248 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700249 "bufferqueue/2.0/H2BProducerListener.cpp",
250 "bufferqueue/2.0/types.cpp",
251 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700252}
253
254// Common build config shared by libgui and libgui_bufferqueue_static.
255cc_defaults {
256 name: "libgui_bufferqueue-defaults",
257
258 clang: true,
259 cflags: [
260 "-Wall",
261 "-Werror",
262 ],
263
264 cppflags: [
265 "-Wextra",
266 "-DDEBUG_ONLY_CODE=0",
267 ],
268
269 product_variables: {
270 eng: {
271 cppflags: [
272 "-UDEBUG_ONLY_CODE",
273 "-DDEBUG_ONLY_CODE=1",
274 ],
275 },
276 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700277
David Stevens7347f0b2020-01-15 20:19:22 +0900278 whole_static_libs: [
279 "LibGuiProperties",
280 ],
281
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700282 shared_libs: [
283 "android.hardware.graphics.bufferqueue@1.0",
284 "android.hardware.graphics.bufferqueue@2.0",
285 "android.hardware.graphics.common@1.1",
286 "android.hardware.graphics.common@1.2",
287 "android.hidl.token@1.0-utils",
288 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700289 "libcutils",
290 "libEGL",
291 "libGLESv2",
292 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700293 "liblog",
294 "libnativewindow",
295 "libsync",
296 "libui",
297 "libutils",
298 "libvndksupport",
299 ],
300
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800301 static_libs: [
302 "libbinderthreadstateutils",
303 ],
304
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700305 header_libs: [
306 "libgui_headers",
307 "libnativebase_headers",
308 ],
309
Ady Abraham62f216c2020-10-13 19:07:23 -0700310 include_dirs: [
311 "frameworks/native/include",
312 ],
313
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700314 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700315 "libEGL",
316 "libnativewindow",
317 "libui",
318 "android.hardware.graphics.bufferqueue@1.0",
319 "android.hardware.graphics.bufferqueue@2.0",
320 "android.hardware.graphics.common@1.1",
321 "android.hardware.graphics.common@1.2",
322 "android.hidl.token@1.0-utils",
323 ],
324
325 export_header_lib_headers: [
326 "libgui_headers",
327 ],
328
329 export_include_dirs: [
330 "include",
331 ],
332}
333
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700334// GMocks for use by external code
335cc_library_static {
336 name: "libgui_mocks",
337 vendor_available: false,
338
339 defaults: ["libgui_bufferqueue-defaults"],
340 static_libs: [
341 "libgtest",
342 "libgmock",
343 ],
344
345 srcs: [
346 "mock/GraphicBufferConsumer.cpp",
347 "mock/GraphicBufferProducer.cpp",
348 ],
349}
350
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700351subdirs = ["tests"]