blob: 4f605e0782ae3f29491cf48f6f547208fa8f978b [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 ],
Jiyong Park172bd722017-06-21 12:14:18 +090030}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070031
32cc_library_shared {
33 name: "libgui",
Jiyong Park99c514e2017-11-17 19:09:31 +090034 vendor_available: false,
Justin Yun71d6c8852017-07-24 15:19:45 +090035 vndk: {
36 enabled: true,
37 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090038 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070039
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070040 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041
42 srcs: [
Lloyd Pique1ebe0902019-10-04 14:47:13 -070043 ":libgui_bufferqueue_sources",
44
Dan Willemsen3106c1c2016-10-03 23:56:51 -070045 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070046 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080047 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080048 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070049 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070050 "ConsumerBase.cpp",
51 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070052 "DebugEGLImageTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070053 "DisplayEventReceiver.cpp",
54 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070055 "GuiConfig.cpp",
56 "IDisplayEventConnection.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080057 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070058 "ISurfaceComposer.cpp",
59 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070060 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080061 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080062 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070063 "LayerState.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070064 "StreamSplitter.cpp",
65 "Surface.cpp",
66 "SurfaceControl.cpp",
67 "SurfaceComposerClient.cpp",
68 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080069 "view/Surface.cpp",
Stan Iliev94a4c4e2019-10-18 19:00:30 -040070 "surfacetexture/SurfaceTexture.cpp",
71 "surfacetexture/ImageConsumer.cpp",
72 "surfacetexture/EGLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070073 ],
74
75 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080076 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070077 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070078 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080079 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080080 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070081 ],
82
Jiyong Parka75d3d62018-04-09 12:16:30 +090083 // bufferhub is not used when building libgui for vendors
84 target: {
85 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080086 cflags: [
87 "-DNO_BUFFERHUB",
88 "-DNO_INPUT",
89 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090090 exclude_srcs: [
91 "BufferHubConsumer.cpp",
92 "BufferHubProducer.cpp",
93 ],
94 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080095 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070096 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090097 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080098 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080099 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900100 ],
101 },
102 },
103
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700104 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800105 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900106 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700107 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700108}
109
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700110// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700111// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700112cc_library_static {
113 name: "libgui_bufferqueue_static",
114 vendor_available: true,
115
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700116 cflags: [
117 "-DNO_BUFFERHUB",
118 ],
119
120 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700121
122 srcs: [
123 ":libgui_bufferqueue_sources",
124 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700125}
126
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700127filegroup {
128 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700129 srcs: [
130 "BufferItem.cpp",
131 "BufferQueue.cpp",
132 "BufferQueueConsumer.cpp",
133 "BufferQueueCore.cpp",
134 "BufferQueueProducer.cpp",
135 "BufferQueueThreadState.cpp",
136 "BufferSlot.cpp",
137 "FrameTimestamps.cpp",
138 "GLConsumerUtils.cpp",
139 "HdrMetadata.cpp",
140 "IConsumerListener.cpp",
141 "IGraphicBufferConsumer.cpp",
142 "IGraphicBufferProducer.cpp",
143 "IProducerListener.cpp",
144 "OccupancyTracker.cpp",
145 "bufferqueue/1.0/B2HProducerListener.cpp",
146 "bufferqueue/1.0/Conversion.cpp",
147 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
148 "bufferqueue/1.0/H2BProducerListener.cpp",
149 "bufferqueue/1.0/WProducerListener.cpp",
150 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
151 "bufferqueue/2.0/B2HProducerListener.cpp",
152 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
153 "bufferqueue/2.0/H2BProducerListener.cpp",
154 "bufferqueue/2.0/types.cpp",
155 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700156}
157
158// Common build config shared by libgui and libgui_bufferqueue_static.
159cc_defaults {
160 name: "libgui_bufferqueue-defaults",
161
162 clang: true,
163 cflags: [
164 "-Wall",
165 "-Werror",
166 ],
167
168 cppflags: [
169 "-Wextra",
170 "-DDEBUG_ONLY_CODE=0",
171 ],
172
173 product_variables: {
174 eng: {
175 cppflags: [
176 "-UDEBUG_ONLY_CODE",
177 "-DDEBUG_ONLY_CODE=1",
178 ],
179 },
180 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700181
182 shared_libs: [
183 "android.hardware.graphics.bufferqueue@1.0",
184 "android.hardware.graphics.bufferqueue@2.0",
185 "android.hardware.graphics.common@1.1",
186 "android.hardware.graphics.common@1.2",
187 "android.hidl.token@1.0-utils",
188 "libbase",
189 "libbinder",
190 "libcutils",
191 "libEGL",
192 "libGLESv2",
193 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700194 "liblog",
195 "libnativewindow",
196 "libsync",
197 "libui",
198 "libutils",
199 "libvndksupport",
200 ],
201
202 header_libs: [
203 "libgui_headers",
204 "libnativebase_headers",
205 ],
206
207 export_shared_lib_headers: [
208 "libbinder",
209 "libEGL",
210 "libnativewindow",
211 "libui",
212 "android.hardware.graphics.bufferqueue@1.0",
213 "android.hardware.graphics.bufferqueue@2.0",
214 "android.hardware.graphics.common@1.1",
215 "android.hardware.graphics.common@1.2",
216 "android.hidl.token@1.0-utils",
217 ],
218
219 export_header_lib_headers: [
220 "libgui_headers",
221 ],
222
223 export_include_dirs: [
224 "include",
225 ],
226}
227
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700228// GMocks for use by external code
229cc_library_static {
230 name: "libgui_mocks",
231 vendor_available: false,
232
233 defaults: ["libgui_bufferqueue-defaults"],
234 static_libs: [
235 "libgtest",
236 "libgmock",
237 ],
238
239 srcs: [
240 "mock/GraphicBufferConsumer.cpp",
241 "mock/GraphicBufferProducer.cpp",
242 ],
243}
244
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700245subdirs = ["tests"]