blob: 127fcd618b6a861b22c40c8b205b505c51c8fae7 [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"],
18}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070019
20cc_library_shared {
21 name: "libgui",
Jiyong Park99c514e2017-11-17 19:09:31 +090022 vendor_available: false,
Justin Yun71d6c8852017-07-24 15:19:45 +090023 vndk: {
24 enabled: true,
25 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090026 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070027
28 clang: true,
Chih-Hung Hsiehd66be0a2017-10-05 13:51:32 -070029 cflags: [
30 "-Wall",
31 "-Werror",
32 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070033 cppflags: [
Lloyd Pique3b745782018-08-31 17:34:40 -070034 "-std=c++1z",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070035 "-Weverything",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070036
37 // The static constructors and destructors in this library have not been noted to
38 // introduce significant overheads
39 "-Wno-exit-time-destructors",
40 "-Wno-global-constructors",
41
42 // We only care about compiling as C++14
43 "-Wno-c++98-compat-pedantic",
44
45 // We don't need to enumerate every case in a switch as long as a default case
46 // is present
47 "-Wno-switch-enum",
48
49 // Allow calling variadic macros without a __VA_ARGS__ list
50 "-Wno-gnu-zero-variadic-macro-arguments",
51
52 // Don't warn about struct padding
53 "-Wno-padded",
54
Dan Stoza71bded52016-10-19 11:10:33 -070055 // We are aware of the risks inherent in comparing floats for equality
56 "-Wno-float-equal",
57
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -080058 // Pure abstract classes trigger this warning
59 "-Wno-weak-vtables",
60
61 // Allow four-character integer literals
Lloyd Pique3b745782018-08-31 17:34:40 -070062 "-Wno-four-char-constants",
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -080063
64 // Allow documentation warnings
65 "-Wno-documentation",
66
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080067 // Allow implicit instantiation for templated class function
68 "-Wno-undefined-func-template",
69
Jiwen 'Steve' Caidc82be72018-02-08 21:28:22 -080070 // Allow explicitly marking struct as packed even when unnecessary
71 "-Wno-packed",
72
Dan Willemsen3106c1c2016-10-03 23:56:51 -070073 "-DDEBUG_ONLY_CODE=0",
74 ],
75
76 product_variables: {
Fabien Sanglard98bfd4f2017-06-22 11:13:49 -070077 eng: {
Dan Willemsen3106c1c2016-10-03 23:56:51 -070078 cppflags: [
79 "-UDEBUG_ONLY_CODE",
80 "-DDEBUG_ONLY_CODE=1",
81 ],
82 },
83 },
84
85 srcs: [
Dan Willemsen3106c1c2016-10-03 23:56:51 -070086 "BitTube.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080087 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080088 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070089 "BufferItem.cpp",
90 "BufferItemConsumer.cpp",
91 "BufferQueue.cpp",
92 "BufferQueueConsumer.cpp",
93 "BufferQueueCore.cpp",
94 "BufferQueueProducer.cpp",
95 "BufferSlot.cpp",
96 "ConsumerBase.cpp",
97 "CpuConsumer.cpp",
98 "DisplayEventReceiver.cpp",
Brian Andersond6927fb2016-07-23 23:37:30 -070099 "FrameTimestamps.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700100 "GLConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700101 "GuiConfig.cpp",
Courtney Goeltzenleuchter9bad0d72017-12-19 12:34:34 -0700102 "HdrMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700103 "IDisplayEventConnection.cpp",
Mathias Agopian801ea092017-03-06 15:05:04 -0800104 "IConsumerListener.cpp",
Mathias Agopian801ea092017-03-06 15:05:04 -0800105 "IGraphicBufferConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700106 "IGraphicBufferProducer.cpp",
107 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700108 "ISurfaceComposer.cpp",
109 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700110 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800111 "LayerDebugInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700112 "LayerState.cpp",
113 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700114 "StreamSplitter.cpp",
115 "Surface.cpp",
116 "SurfaceControl.cpp",
117 "SurfaceComposerClient.cpp",
118 "SyncFeatures.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800119 "view/Surface.cpp",
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -0800120 "bufferqueue/1.0/B2HProducerListener.cpp",
Lloyd Pique3b745782018-08-31 17:34:40 -0700121 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700122 ],
123
124 shared_libs: [
Peiyong Lina52f0292018-03-14 17:26:31 -0700125 "android.hardware.graphics.common@1.1",
Jesse Hall153fbc82017-01-03 16:18:15 -0800126 "libsync",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700127 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700128 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700129 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -0800130 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700131 "libcutils",
132 "libEGL",
133 "libGLESv2",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700134 "libui",
135 "libutils",
Mathias Agopian89ed4c82017-02-09 18:48:34 -0800136 "libnativewindow",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700137 "liblog",
Robert Carr2c358bf2018-08-08 15:58:15 -0700138 "libinput",
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -0800139 "libhidlbase",
Courtney Goeltzenleuchtera0c93e12017-03-17 16:16:48 -0600140 "libhidltransport",
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -0800141 "android.hidl.token@1.0-utils",
142 "android.hardware.graphics.bufferqueue@1.0",
Courtney Goeltzenleuchtera0c93e12017-03-17 16:16:48 -0600143 "android.hardware.configstore@1.0",
Jaesoo Lee3e85cbe2017-03-30 15:24:15 +0900144 "android.hardware.configstore-utils",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700145 ],
146
Jiyong Parka75d3d62018-04-09 12:16:30 +0900147 // bufferhub is not used when building libgui for vendors
148 target: {
149 vendor: {
Robert Carr2c358bf2018-08-08 15:58:15 -0700150 cflags: ["-DNO_BUFFERHUB", "-DNO_INPUT"],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900151 exclude_srcs: [
152 "BufferHubConsumer.cpp",
153 "BufferHubProducer.cpp",
154 ],
155 exclude_shared_libs: [
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700156 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900157 "libbufferhubqueue",
158 "libpdx_default_transport",
Robert Carr2c358bf2018-08-08 15:58:15 -0700159 "libinput"
Jiyong Parka75d3d62018-04-09 12:16:30 +0900160 ],
161 },
162 },
163
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700164 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800165 "libdvr_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700166 "libnativebase_headers",
Jiyong Park172bd722017-06-21 12:14:18 +0900167 "libgui_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900168 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700169 ],
170
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -0800171 export_shared_lib_headers: [
172 "libbinder",
Steven Moreland33f64842017-06-22 17:50:49 -0700173 "libEGL",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700174 "libnativewindow",
Steven Moreland33f64842017-06-22 17:50:49 -0700175 "libui",
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -0800176 "android.hidl.token@1.0-utils",
177 "android.hardware.graphics.bufferqueue@1.0",
Peiyong Lina52f0292018-03-14 17:26:31 -0700178 "android.hardware.graphics.common@1.1",
Pawin Vongmasa6e1193a2017-03-07 13:08:40 -0800179 ],
Dan Stoza1e438d22017-03-31 16:18:10 -0700180
Jiyong Park172bd722017-06-21 12:14:18 +0900181 export_header_lib_headers: [
182 "libgui_headers",
183 ],
184
Dan Stoza1e438d22017-03-31 16:18:10 -0700185 export_include_dirs: [
186 "include",
187 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700188}
189
190subdirs = ["tests"]