blob: e6d442d22569534b4ec83cd797a05ebdb7c1a544 [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
20 export_shared_lib_headers: [ "android.hidl.token@1.0-utils" ],
21 shared_libs: [ "android.hidl.token@1.0-utils" ],
Jiyong Park172bd722017-06-21 12:14:18 +090022}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070023
24cc_library_shared {
25 name: "libgui",
Jiyong Park99c514e2017-11-17 19:09:31 +090026 vendor_available: false,
Justin Yun71d6c8852017-07-24 15:19:45 +090027 vndk: {
28 enabled: true,
29 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090030 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070031
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070032 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070033
34 srcs: [
Lloyd Pique1ebe0902019-10-04 14:47:13 -070035 ":libgui_bufferqueue_sources",
36
Dan Willemsen3106c1c2016-10-03 23:56:51 -070037 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070038 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080039 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080040 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070042 "ConsumerBase.cpp",
43 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070044 "DebugEGLImageTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070045 "DisplayEventReceiver.cpp",
46 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070047 "GuiConfig.cpp",
48 "IDisplayEventConnection.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080049 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070050 "ISurfaceComposer.cpp",
51 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070052 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080053 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080054 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070055 "LayerState.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070056 "StreamSplitter.cpp",
57 "Surface.cpp",
58 "SurfaceControl.cpp",
59 "SurfaceComposerClient.cpp",
60 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080061 "view/Surface.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070062 ],
63
64 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080065 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070066 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070067 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080068 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080069 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070070 ],
71
Jiyong Parka75d3d62018-04-09 12:16:30 +090072 // bufferhub is not used when building libgui for vendors
73 target: {
74 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080075 cflags: [
76 "-DNO_BUFFERHUB",
77 "-DNO_INPUT",
78 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090079 exclude_srcs: [
80 "BufferHubConsumer.cpp",
81 "BufferHubProducer.cpp",
82 ],
83 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080084 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070085 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090086 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080087 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080088 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +090089 ],
90 },
91 },
92
Mathias Agopian6a3c05b2017-04-27 20:06:55 -070093 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080094 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +090095 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -070096 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070097}
98
Chong Zhang60fa4fd2019-04-19 10:00:27 -070099// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700100// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700101cc_library_static {
102 name: "libgui_bufferqueue_static",
103 vendor_available: true,
104
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700105 cflags: [
106 "-DNO_BUFFERHUB",
107 ],
108
109 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700110
111 srcs: [
112 ":libgui_bufferqueue_sources",
113 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700114}
115
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700116filegroup {
117 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700118 srcs: [
119 "BufferItem.cpp",
120 "BufferQueue.cpp",
121 "BufferQueueConsumer.cpp",
122 "BufferQueueCore.cpp",
123 "BufferQueueProducer.cpp",
124 "BufferQueueThreadState.cpp",
125 "BufferSlot.cpp",
126 "FrameTimestamps.cpp",
127 "GLConsumerUtils.cpp",
128 "HdrMetadata.cpp",
129 "IConsumerListener.cpp",
130 "IGraphicBufferConsumer.cpp",
131 "IGraphicBufferProducer.cpp",
132 "IProducerListener.cpp",
133 "OccupancyTracker.cpp",
134 "bufferqueue/1.0/B2HProducerListener.cpp",
135 "bufferqueue/1.0/Conversion.cpp",
136 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
137 "bufferqueue/1.0/H2BProducerListener.cpp",
138 "bufferqueue/1.0/WProducerListener.cpp",
139 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
140 "bufferqueue/2.0/B2HProducerListener.cpp",
141 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
142 "bufferqueue/2.0/H2BProducerListener.cpp",
143 "bufferqueue/2.0/types.cpp",
144 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700145}
146
147// Common build config shared by libgui and libgui_bufferqueue_static.
148cc_defaults {
149 name: "libgui_bufferqueue-defaults",
150
151 clang: true,
152 cflags: [
153 "-Wall",
154 "-Werror",
155 ],
156
157 cppflags: [
158 "-Wextra",
159 "-DDEBUG_ONLY_CODE=0",
160 ],
161
162 product_variables: {
163 eng: {
164 cppflags: [
165 "-UDEBUG_ONLY_CODE",
166 "-DDEBUG_ONLY_CODE=1",
167 ],
168 },
169 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700170
171 shared_libs: [
172 "android.hardware.graphics.bufferqueue@1.0",
173 "android.hardware.graphics.bufferqueue@2.0",
174 "android.hardware.graphics.common@1.1",
175 "android.hardware.graphics.common@1.2",
176 "android.hidl.token@1.0-utils",
177 "libbase",
178 "libbinder",
179 "libcutils",
180 "libEGL",
181 "libGLESv2",
182 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700183 "liblog",
184 "libnativewindow",
185 "libsync",
186 "libui",
187 "libutils",
188 "libvndksupport",
189 ],
190
191 header_libs: [
192 "libgui_headers",
193 "libnativebase_headers",
194 ],
195
196 export_shared_lib_headers: [
197 "libbinder",
198 "libEGL",
199 "libnativewindow",
200 "libui",
201 "android.hardware.graphics.bufferqueue@1.0",
202 "android.hardware.graphics.bufferqueue@2.0",
203 "android.hardware.graphics.common@1.1",
204 "android.hardware.graphics.common@1.2",
205 "android.hidl.token@1.0-utils",
206 ],
207
208 export_header_lib_headers: [
209 "libgui_headers",
210 ],
211
212 export_include_dirs: [
213 "include",
214 ],
215}
216
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700217// GMocks for use by external code
218cc_library_static {
219 name: "libgui_mocks",
220 vendor_available: false,
221
222 defaults: ["libgui_bufferqueue-defaults"],
223 static_libs: [
224 "libgtest",
225 "libgmock",
226 ],
227
228 srcs: [
229 "mock/GraphicBufferConsumer.cpp",
230 "mock/GraphicBufferProducer.cpp",
231 ],
232}
233
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700234subdirs = ["tests"]