blob: 7f57f5dd4ebe21f25820b6877da472ab9875c6e6 [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",
Chong Zhang62493092020-01-15 16:04:47 -080058 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070059 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080060 "IGraphicBufferConsumer.cpp",
61 "IGraphicBufferProducer.cpp",
62 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080063 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070064 "ISurfaceComposer.cpp",
65 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070066 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080067 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080068 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070069 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080070 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070071 "StreamSplitter.cpp",
72 "Surface.cpp",
73 "SurfaceControl.cpp",
74 "SurfaceComposerClient.cpp",
75 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080076 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080077 "bufferqueue/1.0/B2HProducerListener.cpp",
78 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
79 "bufferqueue/2.0/B2HProducerListener.cpp",
80 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070081 ],
82
83 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080084 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -080085 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070086 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070087 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080088 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080089 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070090 ],
91
Chong Zhang62493092020-01-15 16:04:47 -080092 export_shared_lib_headers: [
93 "libbinder",
94 ],
95
Jiyong Parka75d3d62018-04-09 12:16:30 +090096 // bufferhub is not used when building libgui for vendors
97 target: {
98 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080099 cflags: [
100 "-DNO_BUFFERHUB",
101 "-DNO_INPUT",
102 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900103 exclude_srcs: [
104 "BufferHubConsumer.cpp",
105 "BufferHubProducer.cpp",
106 ],
107 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800108 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700109 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900110 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800111 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800112 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900113 ],
114 },
115 },
116
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700117 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800118 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900119 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700120 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900121
122 aidl: {
123 export_aidl_headers: true,
124 }
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700125}
126
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700127// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700128// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700129cc_library_static {
130 name: "libgui_bufferqueue_static",
131 vendor_available: true,
132
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700133 cflags: [
134 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800135 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700136 ],
137
138 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700139
140 srcs: [
141 ":libgui_bufferqueue_sources",
142 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700143}
144
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700145filegroup {
146 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700147 srcs: [
148 "BufferItem.cpp",
149 "BufferQueue.cpp",
150 "BufferQueueConsumer.cpp",
151 "BufferQueueCore.cpp",
152 "BufferQueueProducer.cpp",
153 "BufferQueueThreadState.cpp",
154 "BufferSlot.cpp",
155 "FrameTimestamps.cpp",
156 "GLConsumerUtils.cpp",
157 "HdrMetadata.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800158 "QueueBufferInputOutput.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700159 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700160 "bufferqueue/1.0/H2BProducerListener.cpp",
161 "bufferqueue/1.0/WProducerListener.cpp",
162 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700163 "bufferqueue/2.0/H2BProducerListener.cpp",
164 "bufferqueue/2.0/types.cpp",
165 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700166}
167
168// Common build config shared by libgui and libgui_bufferqueue_static.
169cc_defaults {
170 name: "libgui_bufferqueue-defaults",
171
172 clang: true,
173 cflags: [
174 "-Wall",
175 "-Werror",
176 ],
177
178 cppflags: [
179 "-Wextra",
180 "-DDEBUG_ONLY_CODE=0",
181 ],
182
183 product_variables: {
184 eng: {
185 cppflags: [
186 "-UDEBUG_ONLY_CODE",
187 "-DDEBUG_ONLY_CODE=1",
188 ],
189 },
190 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700191
David Stevens7347f0b2020-01-15 20:19:22 +0900192 whole_static_libs: [
193 "LibGuiProperties",
194 ],
195
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700196 shared_libs: [
197 "android.hardware.graphics.bufferqueue@1.0",
198 "android.hardware.graphics.bufferqueue@2.0",
199 "android.hardware.graphics.common@1.1",
200 "android.hardware.graphics.common@1.2",
201 "android.hidl.token@1.0-utils",
202 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700203 "libcutils",
204 "libEGL",
205 "libGLESv2",
206 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700207 "liblog",
208 "libnativewindow",
209 "libsync",
210 "libui",
211 "libutils",
212 "libvndksupport",
213 ],
214
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800215 static_libs: [
216 "libbinderthreadstateutils",
217 ],
218
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700219 header_libs: [
220 "libgui_headers",
221 "libnativebase_headers",
222 ],
223
224 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700225 "libEGL",
226 "libnativewindow",
227 "libui",
228 "android.hardware.graphics.bufferqueue@1.0",
229 "android.hardware.graphics.bufferqueue@2.0",
230 "android.hardware.graphics.common@1.1",
231 "android.hardware.graphics.common@1.2",
232 "android.hidl.token@1.0-utils",
233 ],
234
235 export_header_lib_headers: [
236 "libgui_headers",
237 ],
238
239 export_include_dirs: [
240 "include",
241 ],
242}
243
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700244// GMocks for use by external code
245cc_library_static {
246 name: "libgui_mocks",
247 vendor_available: false,
248
249 defaults: ["libgui_bufferqueue-defaults"],
250 static_libs: [
251 "libgtest",
252 "libgmock",
253 ],
254
255 srcs: [
256 "mock/GraphicBufferConsumer.cpp",
257 "mock/GraphicBufferProducer.cpp",
258 ],
259}
260
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700261subdirs = ["tests"]