blob: 1ae148c787ef39528e8da357249435a9e790200c [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",
Alec Mouri77a53872019-10-28 16:44:36 -070053 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070054 "DisplayEventReceiver.cpp",
55 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070056 "GuiConfig.cpp",
57 "IDisplayEventConnection.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080058 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070059 "ISurfaceComposer.cpp",
60 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070061 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080062 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080063 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070064 "LayerState.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070065 "StreamSplitter.cpp",
66 "Surface.cpp",
67 "SurfaceControl.cpp",
68 "SurfaceComposerClient.cpp",
69 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080070 "view/Surface.cpp",
Stan Iliev94a4c4e2019-10-18 19:00:30 -040071 "surfacetexture/SurfaceTexture.cpp",
72 "surfacetexture/ImageConsumer.cpp",
73 "surfacetexture/EGLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070074 ],
75
76 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080077 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070078 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070079 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080080 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080081 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070082 ],
83
Jiyong Parka75d3d62018-04-09 12:16:30 +090084 // bufferhub is not used when building libgui for vendors
85 target: {
86 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080087 cflags: [
88 "-DNO_BUFFERHUB",
89 "-DNO_INPUT",
90 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090091 exclude_srcs: [
92 "BufferHubConsumer.cpp",
93 "BufferHubProducer.cpp",
94 ],
95 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080096 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070097 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090098 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080099 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800100 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900101 ],
102 },
103 },
104
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700105 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800106 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900107 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700108 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700109}
110
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700111// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700112// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700113cc_library_static {
114 name: "libgui_bufferqueue_static",
115 vendor_available: true,
116
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700117 cflags: [
118 "-DNO_BUFFERHUB",
119 ],
120
121 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700122
123 srcs: [
124 ":libgui_bufferqueue_sources",
125 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700126}
127
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700128filegroup {
129 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700130 srcs: [
131 "BufferItem.cpp",
132 "BufferQueue.cpp",
133 "BufferQueueConsumer.cpp",
134 "BufferQueueCore.cpp",
135 "BufferQueueProducer.cpp",
136 "BufferQueueThreadState.cpp",
137 "BufferSlot.cpp",
138 "FrameTimestamps.cpp",
139 "GLConsumerUtils.cpp",
140 "HdrMetadata.cpp",
141 "IConsumerListener.cpp",
142 "IGraphicBufferConsumer.cpp",
143 "IGraphicBufferProducer.cpp",
144 "IProducerListener.cpp",
145 "OccupancyTracker.cpp",
146 "bufferqueue/1.0/B2HProducerListener.cpp",
147 "bufferqueue/1.0/Conversion.cpp",
148 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
149 "bufferqueue/1.0/H2BProducerListener.cpp",
150 "bufferqueue/1.0/WProducerListener.cpp",
151 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
152 "bufferqueue/2.0/B2HProducerListener.cpp",
153 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
154 "bufferqueue/2.0/H2BProducerListener.cpp",
155 "bufferqueue/2.0/types.cpp",
156 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700157}
158
159// Common build config shared by libgui and libgui_bufferqueue_static.
160cc_defaults {
161 name: "libgui_bufferqueue-defaults",
162
163 clang: true,
164 cflags: [
165 "-Wall",
166 "-Werror",
167 ],
168
169 cppflags: [
170 "-Wextra",
171 "-DDEBUG_ONLY_CODE=0",
172 ],
173
174 product_variables: {
175 eng: {
176 cppflags: [
177 "-UDEBUG_ONLY_CODE",
178 "-DDEBUG_ONLY_CODE=1",
179 ],
180 },
181 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700182
183 shared_libs: [
184 "android.hardware.graphics.bufferqueue@1.0",
185 "android.hardware.graphics.bufferqueue@2.0",
186 "android.hardware.graphics.common@1.1",
187 "android.hardware.graphics.common@1.2",
188 "android.hidl.token@1.0-utils",
189 "libbase",
190 "libbinder",
191 "libcutils",
192 "libEGL",
193 "libGLESv2",
194 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700195 "liblog",
196 "libnativewindow",
197 "libsync",
198 "libui",
199 "libutils",
200 "libvndksupport",
201 ],
202
203 header_libs: [
204 "libgui_headers",
205 "libnativebase_headers",
206 ],
207
208 export_shared_lib_headers: [
209 "libbinder",
210 "libEGL",
211 "libnativewindow",
212 "libui",
213 "android.hardware.graphics.bufferqueue@1.0",
214 "android.hardware.graphics.bufferqueue@2.0",
215 "android.hardware.graphics.common@1.1",
216 "android.hardware.graphics.common@1.2",
217 "android.hidl.token@1.0-utils",
218 ],
219
220 export_header_lib_headers: [
221 "libgui_headers",
222 ],
223
224 export_include_dirs: [
225 "include",
226 ],
227}
228
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700229// GMocks for use by external code
230cc_library_static {
231 name: "libgui_mocks",
232 vendor_available: false,
233
234 defaults: ["libgui_bufferqueue-defaults"],
235 static_libs: [
236 "libgtest",
237 "libgmock",
238 ],
239
240 srcs: [
241 "mock/GraphicBufferConsumer.cpp",
242 "mock/GraphicBufferProducer.cpp",
243 ],
244}
245
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700246subdirs = ["tests"]