blob: b360a268dbda0b6650530b25c42b9879ea4e360c [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",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070070 ],
71
72 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080073 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070074 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070075 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080076 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080077 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070078 ],
79
Jiyong Parka75d3d62018-04-09 12:16:30 +090080 // bufferhub is not used when building libgui for vendors
81 target: {
82 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080083 cflags: [
84 "-DNO_BUFFERHUB",
85 "-DNO_INPUT",
86 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090087 exclude_srcs: [
88 "BufferHubConsumer.cpp",
89 "BufferHubProducer.cpp",
90 ],
91 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080092 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070093 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090094 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080095 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080096 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +090097 ],
98 },
99 },
100
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700101 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800102 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900103 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700104 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700105}
106
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700107// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700108// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700109cc_library_static {
110 name: "libgui_bufferqueue_static",
111 vendor_available: true,
112
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700113 cflags: [
114 "-DNO_BUFFERHUB",
115 ],
116
117 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700118
119 srcs: [
120 ":libgui_bufferqueue_sources",
121 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700122}
123
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700124filegroup {
125 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700126 srcs: [
127 "BufferItem.cpp",
128 "BufferQueue.cpp",
129 "BufferQueueConsumer.cpp",
130 "BufferQueueCore.cpp",
131 "BufferQueueProducer.cpp",
132 "BufferQueueThreadState.cpp",
133 "BufferSlot.cpp",
134 "FrameTimestamps.cpp",
135 "GLConsumerUtils.cpp",
136 "HdrMetadata.cpp",
137 "IConsumerListener.cpp",
138 "IGraphicBufferConsumer.cpp",
139 "IGraphicBufferProducer.cpp",
140 "IProducerListener.cpp",
141 "OccupancyTracker.cpp",
142 "bufferqueue/1.0/B2HProducerListener.cpp",
143 "bufferqueue/1.0/Conversion.cpp",
144 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
145 "bufferqueue/1.0/H2BProducerListener.cpp",
146 "bufferqueue/1.0/WProducerListener.cpp",
147 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
148 "bufferqueue/2.0/B2HProducerListener.cpp",
149 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
150 "bufferqueue/2.0/H2BProducerListener.cpp",
151 "bufferqueue/2.0/types.cpp",
152 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700153}
154
155// Common build config shared by libgui and libgui_bufferqueue_static.
156cc_defaults {
157 name: "libgui_bufferqueue-defaults",
158
159 clang: true,
160 cflags: [
161 "-Wall",
162 "-Werror",
163 ],
164
165 cppflags: [
166 "-Wextra",
167 "-DDEBUG_ONLY_CODE=0",
168 ],
169
170 product_variables: {
171 eng: {
172 cppflags: [
173 "-UDEBUG_ONLY_CODE",
174 "-DDEBUG_ONLY_CODE=1",
175 ],
176 },
177 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700178
179 shared_libs: [
180 "android.hardware.graphics.bufferqueue@1.0",
181 "android.hardware.graphics.bufferqueue@2.0",
182 "android.hardware.graphics.common@1.1",
183 "android.hardware.graphics.common@1.2",
184 "android.hidl.token@1.0-utils",
185 "libbase",
186 "libbinder",
187 "libcutils",
188 "libEGL",
189 "libGLESv2",
190 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700191 "liblog",
192 "libnativewindow",
193 "libsync",
194 "libui",
195 "libutils",
196 "libvndksupport",
197 ],
198
199 header_libs: [
200 "libgui_headers",
201 "libnativebase_headers",
202 ],
203
204 export_shared_lib_headers: [
205 "libbinder",
206 "libEGL",
207 "libnativewindow",
208 "libui",
209 "android.hardware.graphics.bufferqueue@1.0",
210 "android.hardware.graphics.bufferqueue@2.0",
211 "android.hardware.graphics.common@1.1",
212 "android.hardware.graphics.common@1.2",
213 "android.hidl.token@1.0-utils",
214 ],
215
216 export_header_lib_headers: [
217 "libgui_headers",
218 ],
219
220 export_include_dirs: [
221 "include",
222 ],
223}
224
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700225// GMocks for use by external code
226cc_library_static {
227 name: "libgui_mocks",
228 vendor_available: false,
229
230 defaults: ["libgui_bufferqueue-defaults"],
231 static_libs: [
232 "libgtest",
233 "libgmock",
234 ],
235
236 srcs: [
237 "mock/GraphicBufferConsumer.cpp",
238 "mock/GraphicBufferProducer.cpp",
239 ],
240}
241
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700242subdirs = ["tests"]