blob: 9285b23d7472711ec3b8f3d9678cfe24c40599c0 [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.
Jiyong Park172bd722017-06-21 12:14:18 +090014cc_library_headers {
15 name: "libgui_headers",
16 vendor_available: true,
17 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070018
19 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070020 export_shared_lib_headers: [
21 "android.hidl.token@1.0-utils",
22 "android.hardware.graphics.bufferqueue@1.0",
23 "android.hardware.graphics.bufferqueue@2.0",
24 ],
25 shared_libs: [
26 "android.hidl.token@1.0-utils",
27 "android.hardware.graphics.bufferqueue@1.0",
28 "android.hardware.graphics.bufferqueue@2.0",
29 ],
Jooyung Han7bcb8932020-04-16 18:48:32 +090030 min_sdk_version: "29",
Jiyong Park172bd722017-06-21 12:14:18 +090031}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070032
33cc_library_shared {
34 name: "libgui",
Jiyong Park99c514e2017-11-17 19:09:31 +090035 vendor_available: false,
Justin Yun71d6c8852017-07-24 15:19:45 +090036 vndk: {
37 enabled: true,
38 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090039 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070040
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070041 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070042
43 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +090044 ":framework_native_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -070045 ":libgui_bufferqueue_sources",
46
Dan Willemsen3106c1c2016-10-03 23:56:51 -070047 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070048 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080049 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080050 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070051 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070052 "ConsumerBase.cpp",
53 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070054 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -070055 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070056 "DisplayEventReceiver.cpp",
57 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070058 "GuiConfig.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080059 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070060 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080061 "IGraphicBufferConsumer.cpp",
62 "IGraphicBufferProducer.cpp",
63 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080064 "IRegionSamplingListener.cpp",
chaviw85bf55a2020-08-17 17:54:24 -070065 "IScreenCaptureListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070066 "ISurfaceComposer.cpp",
67 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070068 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080069 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080070 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070071 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080072 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070073 "StreamSplitter.cpp",
74 "Surface.cpp",
75 "SurfaceControl.cpp",
76 "SurfaceComposerClient.cpp",
77 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080078 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080079 "bufferqueue/1.0/B2HProducerListener.cpp",
80 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
81 "bufferqueue/2.0/B2HProducerListener.cpp",
82 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070083 ],
84
85 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080086 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -080087 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070088 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070089 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080090 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080091 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070092 ],
93
Chong Zhang62493092020-01-15 16:04:47 -080094 export_shared_lib_headers: [
95 "libbinder",
Vishnu Naire798b472020-07-23 13:52:21 -070096 "libinput",
Chong Zhang62493092020-01-15 16:04:47 -080097 ],
98
Jiyong Parka75d3d62018-04-09 12:16:30 +090099 // bufferhub is not used when building libgui for vendors
100 target: {
101 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800102 cflags: [
103 "-DNO_BUFFERHUB",
104 "-DNO_INPUT",
105 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900106 exclude_srcs: [
107 "BufferHubConsumer.cpp",
108 "BufferHubProducer.cpp",
109 ],
110 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800111 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700112 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900113 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800114 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800115 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900116 ],
117 },
118 },
119
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700120 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800121 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900122 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700123 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900124
125 aidl: {
126 export_aidl_headers: true,
127 }
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700128}
129
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700130// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700131// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700132cc_library_static {
133 name: "libgui_bufferqueue_static",
134 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900135 apex_available: [
136 "//apex_available:platform",
137 "com.android.media.swcodec",
138 ],
139 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700140
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700141 cflags: [
142 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800143 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700144 ],
145
146 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700147
148 srcs: [
149 ":libgui_bufferqueue_sources",
150 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700151}
152
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700153filegroup {
154 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700155 srcs: [
156 "BufferItem.cpp",
157 "BufferQueue.cpp",
158 "BufferQueueConsumer.cpp",
159 "BufferQueueCore.cpp",
160 "BufferQueueProducer.cpp",
161 "BufferQueueThreadState.cpp",
162 "BufferSlot.cpp",
163 "FrameTimestamps.cpp",
164 "GLConsumerUtils.cpp",
165 "HdrMetadata.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800166 "QueueBufferInputOutput.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700167 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700168 "bufferqueue/1.0/H2BProducerListener.cpp",
169 "bufferqueue/1.0/WProducerListener.cpp",
170 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700171 "bufferqueue/2.0/H2BProducerListener.cpp",
172 "bufferqueue/2.0/types.cpp",
173 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700174}
175
176// Common build config shared by libgui and libgui_bufferqueue_static.
177cc_defaults {
178 name: "libgui_bufferqueue-defaults",
179
180 clang: true,
181 cflags: [
182 "-Wall",
183 "-Werror",
184 ],
185
186 cppflags: [
187 "-Wextra",
188 "-DDEBUG_ONLY_CODE=0",
189 ],
190
191 product_variables: {
192 eng: {
193 cppflags: [
194 "-UDEBUG_ONLY_CODE",
195 "-DDEBUG_ONLY_CODE=1",
196 ],
197 },
198 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700199
David Stevens7347f0b2020-01-15 20:19:22 +0900200 whole_static_libs: [
201 "LibGuiProperties",
202 ],
203
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700204 shared_libs: [
205 "android.hardware.graphics.bufferqueue@1.0",
206 "android.hardware.graphics.bufferqueue@2.0",
207 "android.hardware.graphics.common@1.1",
208 "android.hardware.graphics.common@1.2",
209 "android.hidl.token@1.0-utils",
210 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700211 "libcutils",
212 "libEGL",
213 "libGLESv2",
214 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700215 "liblog",
216 "libnativewindow",
217 "libsync",
218 "libui",
219 "libutils",
220 "libvndksupport",
221 ],
222
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800223 static_libs: [
224 "libbinderthreadstateutils",
225 ],
226
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700227 header_libs: [
228 "libgui_headers",
229 "libnativebase_headers",
230 ],
231
232 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700233 "libEGL",
234 "libnativewindow",
235 "libui",
236 "android.hardware.graphics.bufferqueue@1.0",
237 "android.hardware.graphics.bufferqueue@2.0",
238 "android.hardware.graphics.common@1.1",
239 "android.hardware.graphics.common@1.2",
240 "android.hidl.token@1.0-utils",
241 ],
242
243 export_header_lib_headers: [
244 "libgui_headers",
245 ],
246
247 export_include_dirs: [
248 "include",
249 ],
250}
251
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700252// GMocks for use by external code
253cc_library_static {
254 name: "libgui_mocks",
255 vendor_available: false,
256
257 defaults: ["libgui_bufferqueue-defaults"],
258 static_libs: [
259 "libgtest",
260 "libgmock",
261 ],
262
263 srcs: [
264 "mock/GraphicBufferConsumer.cpp",
265 "mock/GraphicBufferProducer.cpp",
266 ],
267}
268
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700269subdirs = ["tests"]