blob: da5167503529eb18b1df2ddb332f7b5aab9c2ef1 [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",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080038 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080039 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070040 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041 "ConsumerBase.cpp",
42 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070043 "DebugEGLImageTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070044 "DisplayEventReceiver.cpp",
45 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070046 "GuiConfig.cpp",
47 "IDisplayEventConnection.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080048 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070049 "ISurfaceComposer.cpp",
50 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070051 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080052 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080053 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070054 "LayerState.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070055 "StreamSplitter.cpp",
56 "Surface.cpp",
57 "SurfaceControl.cpp",
58 "SurfaceComposerClient.cpp",
59 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080060 "view/Surface.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070061 ],
62
63 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080064 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070065 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070066 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -080067 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080068 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070069 ],
70
Jiyong Parka75d3d62018-04-09 12:16:30 +090071 // bufferhub is not used when building libgui for vendors
72 target: {
73 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080074 cflags: [
75 "-DNO_BUFFERHUB",
76 "-DNO_INPUT",
77 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +090078 exclude_srcs: [
79 "BufferHubConsumer.cpp",
80 "BufferHubProducer.cpp",
81 ],
82 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080083 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070084 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +090085 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -080086 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -080087 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +090088 ],
89 },
90 },
91
Mathias Agopian6a3c05b2017-04-27 20:06:55 -070092 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080093 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +090094 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -070095 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070096}
97
Chong Zhang60fa4fd2019-04-19 10:00:27 -070098// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070099// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700100cc_library_static {
101 name: "libgui_bufferqueue_static",
102 vendor_available: true,
103
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700104 cflags: [
105 "-DNO_BUFFERHUB",
106 ],
107
108 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700109
110 srcs: [
111 ":libgui_bufferqueue_sources",
112 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700113}
114
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700115filegroup {
116 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700117 srcs: [
118 "BufferItem.cpp",
119 "BufferQueue.cpp",
120 "BufferQueueConsumer.cpp",
121 "BufferQueueCore.cpp",
122 "BufferQueueProducer.cpp",
123 "BufferQueueThreadState.cpp",
124 "BufferSlot.cpp",
125 "FrameTimestamps.cpp",
126 "GLConsumerUtils.cpp",
127 "HdrMetadata.cpp",
128 "IConsumerListener.cpp",
129 "IGraphicBufferConsumer.cpp",
130 "IGraphicBufferProducer.cpp",
131 "IProducerListener.cpp",
132 "OccupancyTracker.cpp",
133 "bufferqueue/1.0/B2HProducerListener.cpp",
134 "bufferqueue/1.0/Conversion.cpp",
135 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
136 "bufferqueue/1.0/H2BProducerListener.cpp",
137 "bufferqueue/1.0/WProducerListener.cpp",
138 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
139 "bufferqueue/2.0/B2HProducerListener.cpp",
140 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
141 "bufferqueue/2.0/H2BProducerListener.cpp",
142 "bufferqueue/2.0/types.cpp",
143 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700144}
145
146// Common build config shared by libgui and libgui_bufferqueue_static.
147cc_defaults {
148 name: "libgui_bufferqueue-defaults",
149
150 clang: true,
151 cflags: [
152 "-Wall",
153 "-Werror",
154 ],
155
156 cppflags: [
157 "-Wextra",
158 "-DDEBUG_ONLY_CODE=0",
159 ],
160
161 product_variables: {
162 eng: {
163 cppflags: [
164 "-UDEBUG_ONLY_CODE",
165 "-DDEBUG_ONLY_CODE=1",
166 ],
167 },
168 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700169
170 shared_libs: [
171 "android.hardware.graphics.bufferqueue@1.0",
172 "android.hardware.graphics.bufferqueue@2.0",
173 "android.hardware.graphics.common@1.1",
174 "android.hardware.graphics.common@1.2",
175 "android.hidl.token@1.0-utils",
176 "libbase",
177 "libbinder",
178 "libcutils",
179 "libEGL",
180 "libGLESv2",
181 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700182 "liblog",
183 "libnativewindow",
184 "libsync",
185 "libui",
186 "libutils",
187 "libvndksupport",
188 ],
189
190 header_libs: [
191 "libgui_headers",
192 "libnativebase_headers",
193 ],
194
195 export_shared_lib_headers: [
196 "libbinder",
197 "libEGL",
198 "libnativewindow",
199 "libui",
200 "android.hardware.graphics.bufferqueue@1.0",
201 "android.hardware.graphics.bufferqueue@2.0",
202 "android.hardware.graphics.common@1.1",
203 "android.hardware.graphics.common@1.2",
204 "android.hidl.token@1.0-utils",
205 ],
206
207 export_header_lib_headers: [
208 "libgui_headers",
209 ],
210
211 export_include_dirs: [
212 "include",
213 ],
214}
215
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700216// GMocks for use by external code
217cc_library_static {
218 name: "libgui_mocks",
219 vendor_available: false,
220
221 defaults: ["libgui_bufferqueue-defaults"],
222 static_libs: [
223 "libgtest",
224 "libgmock",
225 ],
226
227 srcs: [
228 "mock/GraphicBufferConsumer.cpp",
229 "mock/GraphicBufferProducer.cpp",
230 ],
231}
232
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700233subdirs = ["tests"]