blob: 59593409dfe659acf2831ee49589b9d2ba963f8a [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: [
Daichi Hironof474d3d2019-11-05 08:54:07 +090043 ":framework_native_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -070044 ":libgui_bufferqueue_sources",
45
Dan Willemsen3106c1c2016-10-03 23:56:51 -070046 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070047 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080048 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080049 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070050 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070051 "ConsumerBase.cpp",
52 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070053 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -070054 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070055 "DisplayEventReceiver.cpp",
56 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070057 "GuiConfig.cpp",
58 "IDisplayEventConnection.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080059 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070060 "ISurfaceComposer.cpp",
61 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070062 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080063 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080064 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070065 "LayerState.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070066 "StreamSplitter.cpp",
67 "Surface.cpp",
68 "SurfaceControl.cpp",
69 "SurfaceComposerClient.cpp",
70 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080071 "view/Surface.cpp",
Stan Iliev94a4c4e2019-10-18 19:00:30 -040072 "surfacetexture/SurfaceTexture.cpp",
73 "surfacetexture/ImageConsumer.cpp",
74 "surfacetexture/EGLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070075 ],
76
77 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080078 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070079 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070080 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080081 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080082 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070083 ],
84
Jiyong Parka75d3d62018-04-09 12:16:30 +090085 // bufferhub is not used when building libgui for vendors
86 target: {
87 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080088 cflags: [
89 "-DNO_BUFFERHUB",
90 "-DNO_INPUT",
91 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090092 exclude_srcs: [
93 "BufferHubConsumer.cpp",
94 "BufferHubProducer.cpp",
95 ],
96 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080097 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070098 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090099 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800100 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800101 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900102 ],
103 },
104 },
105
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700106 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800107 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900108 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700109 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900110
111 aidl: {
112 export_aidl_headers: true,
113 }
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700114}
115
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700116// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700117// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700118cc_library_static {
119 name: "libgui_bufferqueue_static",
120 vendor_available: true,
121
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700122 cflags: [
123 "-DNO_BUFFERHUB",
124 ],
125
126 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700127
128 srcs: [
129 ":libgui_bufferqueue_sources",
130 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700131}
132
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700133filegroup {
134 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700135 srcs: [
136 "BufferItem.cpp",
137 "BufferQueue.cpp",
138 "BufferQueueConsumer.cpp",
139 "BufferQueueCore.cpp",
140 "BufferQueueProducer.cpp",
141 "BufferQueueThreadState.cpp",
142 "BufferSlot.cpp",
143 "FrameTimestamps.cpp",
144 "GLConsumerUtils.cpp",
145 "HdrMetadata.cpp",
146 "IConsumerListener.cpp",
147 "IGraphicBufferConsumer.cpp",
148 "IGraphicBufferProducer.cpp",
149 "IProducerListener.cpp",
150 "OccupancyTracker.cpp",
151 "bufferqueue/1.0/B2HProducerListener.cpp",
152 "bufferqueue/1.0/Conversion.cpp",
153 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
154 "bufferqueue/1.0/H2BProducerListener.cpp",
155 "bufferqueue/1.0/WProducerListener.cpp",
156 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
157 "bufferqueue/2.0/B2HProducerListener.cpp",
158 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
159 "bufferqueue/2.0/H2BProducerListener.cpp",
160 "bufferqueue/2.0/types.cpp",
161 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700162}
163
164// Common build config shared by libgui and libgui_bufferqueue_static.
165cc_defaults {
166 name: "libgui_bufferqueue-defaults",
167
168 clang: true,
169 cflags: [
170 "-Wall",
171 "-Werror",
172 ],
173
174 cppflags: [
175 "-Wextra",
176 "-DDEBUG_ONLY_CODE=0",
177 ],
178
179 product_variables: {
180 eng: {
181 cppflags: [
182 "-UDEBUG_ONLY_CODE",
183 "-DDEBUG_ONLY_CODE=1",
184 ],
185 },
186 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700187
188 shared_libs: [
189 "android.hardware.graphics.bufferqueue@1.0",
190 "android.hardware.graphics.bufferqueue@2.0",
191 "android.hardware.graphics.common@1.1",
192 "android.hardware.graphics.common@1.2",
193 "android.hidl.token@1.0-utils",
194 "libbase",
195 "libbinder",
196 "libcutils",
197 "libEGL",
198 "libGLESv2",
199 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700200 "liblog",
201 "libnativewindow",
202 "libsync",
203 "libui",
204 "libutils",
205 "libvndksupport",
206 ],
207
208 header_libs: [
209 "libgui_headers",
210 "libnativebase_headers",
211 ],
212
213 export_shared_lib_headers: [
214 "libbinder",
215 "libEGL",
216 "libnativewindow",
217 "libui",
218 "android.hardware.graphics.bufferqueue@1.0",
219 "android.hardware.graphics.bufferqueue@2.0",
220 "android.hardware.graphics.common@1.1",
221 "android.hardware.graphics.common@1.2",
222 "android.hidl.token@1.0-utils",
223 ],
224
225 export_header_lib_headers: [
226 "libgui_headers",
227 ],
228
229 export_include_dirs: [
230 "include",
231 ],
232}
233
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700234// GMocks for use by external code
235cc_library_static {
236 name: "libgui_mocks",
237 vendor_available: false,
238
239 defaults: ["libgui_bufferqueue-defaults"],
240 static_libs: [
241 "libgtest",
242 "libgmock",
243 ],
244
245 srcs: [
246 "mock/GraphicBufferConsumer.cpp",
247 "mock/GraphicBufferProducer.cpp",
248 ],
249}
250
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700251subdirs = ["tests"]