blob: 40c044df0a92d0554972b88c5936e13e5e0cfc45 [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",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070072 ],
73
74 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080075 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070076 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070077 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080078 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080079 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070080 ],
81
Jiyong Parka75d3d62018-04-09 12:16:30 +090082 // bufferhub is not used when building libgui for vendors
83 target: {
84 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080085 cflags: [
86 "-DNO_BUFFERHUB",
87 "-DNO_INPUT",
88 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090089 exclude_srcs: [
90 "BufferHubConsumer.cpp",
91 "BufferHubProducer.cpp",
92 ],
93 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080094 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070095 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090096 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080097 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080098 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +090099 ],
100 },
101 },
102
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700103 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800104 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900105 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700106 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900107
108 aidl: {
109 export_aidl_headers: true,
110 }
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700111}
112
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700113// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700114// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700115cc_library_static {
116 name: "libgui_bufferqueue_static",
117 vendor_available: true,
118
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700119 cflags: [
120 "-DNO_BUFFERHUB",
121 ],
122
123 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700124
125 srcs: [
126 ":libgui_bufferqueue_sources",
127 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700128}
129
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700130filegroup {
131 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700132 srcs: [
133 "BufferItem.cpp",
134 "BufferQueue.cpp",
135 "BufferQueueConsumer.cpp",
136 "BufferQueueCore.cpp",
137 "BufferQueueProducer.cpp",
138 "BufferQueueThreadState.cpp",
139 "BufferSlot.cpp",
140 "FrameTimestamps.cpp",
141 "GLConsumerUtils.cpp",
142 "HdrMetadata.cpp",
143 "IConsumerListener.cpp",
144 "IGraphicBufferConsumer.cpp",
145 "IGraphicBufferProducer.cpp",
146 "IProducerListener.cpp",
147 "OccupancyTracker.cpp",
148 "bufferqueue/1.0/B2HProducerListener.cpp",
149 "bufferqueue/1.0/Conversion.cpp",
150 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
151 "bufferqueue/1.0/H2BProducerListener.cpp",
152 "bufferqueue/1.0/WProducerListener.cpp",
153 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
154 "bufferqueue/2.0/B2HProducerListener.cpp",
155 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
156 "bufferqueue/2.0/H2BProducerListener.cpp",
157 "bufferqueue/2.0/types.cpp",
158 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700159}
160
161// Common build config shared by libgui and libgui_bufferqueue_static.
162cc_defaults {
163 name: "libgui_bufferqueue-defaults",
164
165 clang: true,
166 cflags: [
167 "-Wall",
168 "-Werror",
169 ],
170
171 cppflags: [
172 "-Wextra",
173 "-DDEBUG_ONLY_CODE=0",
174 ],
175
176 product_variables: {
177 eng: {
178 cppflags: [
179 "-UDEBUG_ONLY_CODE",
180 "-DDEBUG_ONLY_CODE=1",
181 ],
182 },
183 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700184
185 shared_libs: [
186 "android.hardware.graphics.bufferqueue@1.0",
187 "android.hardware.graphics.bufferqueue@2.0",
188 "android.hardware.graphics.common@1.1",
189 "android.hardware.graphics.common@1.2",
190 "android.hidl.token@1.0-utils",
191 "libbase",
192 "libbinder",
193 "libcutils",
194 "libEGL",
195 "libGLESv2",
196 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700197 "liblog",
198 "libnativewindow",
199 "libsync",
200 "libui",
201 "libutils",
202 "libvndksupport",
203 ],
204
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800205 static_libs: [
206 "libbinderthreadstateutils",
207 ],
208
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700209 header_libs: [
210 "libgui_headers",
211 "libnativebase_headers",
212 ],
213
214 export_shared_lib_headers: [
215 "libbinder",
216 "libEGL",
217 "libnativewindow",
218 "libui",
219 "android.hardware.graphics.bufferqueue@1.0",
220 "android.hardware.graphics.bufferqueue@2.0",
221 "android.hardware.graphics.common@1.1",
222 "android.hardware.graphics.common@1.2",
223 "android.hidl.token@1.0-utils",
224 ],
225
226 export_header_lib_headers: [
227 "libgui_headers",
228 ],
229
230 export_include_dirs: [
231 "include",
232 ],
233}
234
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700235// GMocks for use by external code
236cc_library_static {
237 name: "libgui_mocks",
238 vendor_available: false,
239
240 defaults: ["libgui_bufferqueue-defaults"],
241 static_libs: [
242 "libgtest",
243 "libgmock",
244 ],
245
246 srcs: [
247 "mock/GraphicBufferConsumer.cpp",
248 "mock/GraphicBufferProducer.cpp",
249 ],
250}
251
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700252subdirs = ["tests"]