blob: 97b76974854b6961165148d0f4c87b9ef3ea1f38 [file] [log] [blame]
Lloyd Pique66ce40d2018-01-23 16:42:19 -08001cc_defaults {
2 name: "surfaceflinger_defaults",
3 cflags: [
Lloyd Pique66ce40d2018-01-23 16:42:19 -08004 "-Wall",
5 "-Werror",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -07006 "-Wformat",
Lloyd Pique755e3192018-01-31 16:46:15 -08007 "-Wthread-safety",
Lloyd Pique66ce40d2018-01-23 16:42:19 -08008 "-Wunused",
9 "-Wunreachable-code",
10 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080011}
12
13cc_defaults {
14 name: "libsurfaceflinger_defaults",
15 defaults: ["surfaceflinger_defaults"],
16 cflags: [
Lloyd Pique70d91362018-10-18 16:02:55 -070017 "-DLOG_TAG=\"SurfaceFlinger\"",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080018 "-DGL_GLEXT_PROTOTYPES",
19 "-DEGL_EGLEXT_PROTOTYPES",
20 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080021 shared_libs: [
mamik94e91f62019-08-19 09:11:33 -070022 "android.frameworks.vr.composer@2.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080023 "android.hardware.configstore-utils",
24 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080025 "android.hardware.configstore@1.1",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080026 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080027 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070028 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080029 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070030 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070031 "android.hardware.graphics.composer@2.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080032 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010033 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080034 "libbase",
35 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080036 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080037 "libcutils",
38 "libdl",
39 "libEGL",
40 "libfmq",
41 "libGLESv1_CM",
42 "libGLESv2",
43 "libgui",
44 "libhardware",
45 "libhidlbase",
46 "libhidltransport",
47 "libhwbinder",
48 "liblayers_proto",
49 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090050 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080051 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070052 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080053 "libprotobuf-cpp-lite",
54 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -070055 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080056 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070057 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080058 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090059 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080060 ],
mamik94e91f62019-08-19 09:11:33 -070061 // VrComposer is not used when building surfaceflinger for vendors
62 target: {
63 vendor: {
64 exclude_shared_libs: [
65 "android.frameworks.vr.composer@2.0",
66 ],
67 },
68 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -080069 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070070 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070071 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080072 "libserviceutils",
73 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080074 "libvr_manager",
75 "libvrflinger",
76 ],
77 header_libs: [
78 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070079 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070080 "android.hardware.graphics.composer@2.3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080081 ],
82 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070083 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070084 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080085 "libserviceutils",
86 ],
87 export_shared_lib_headers: [
88 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080089 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070090 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080091 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070092 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070093 "android.hardware.graphics.composer@2.3",
Michael Wright5d22d4f2018-06-21 02:50:34 +010094 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080095 "libhidlbase",
96 "libhidltransport",
97 "libhwbinder",
98 ],
99}
100
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700101cc_defaults {
102 name: "libsurfaceflinger_production_defaults",
103 defaults: ["libsurfaceflinger_defaults"],
104 cflags: [
105 "-fvisibility=hidden",
106 "-fwhole-program-vtables", // requires ThinLTO
107 ],
108 lto: {
109 thin: true,
110 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700111 // TODO(b/131771163): Fix broken fuzzer support with LTO.
112 sanitize: {
113 fuzzer: false,
114 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700115}
116
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800117cc_library_headers {
118 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800119 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800120 static_libs: ["libserviceutils"],
121 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800122}
Kalle Raitaa099a242017-01-11 11:17:29 -0800123
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800124filegroup {
125 name: "libsurfaceflinger_sources",
126 srcs: [
127 "BufferLayer.cpp",
128 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700129 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700130 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700131 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800132 "Client.cpp",
133 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800134 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800135 "DisplayDevice.cpp",
136 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700137 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800138 "DisplayHardware/FramebufferSurface.cpp",
139 "DisplayHardware/HWC2.cpp",
140 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100141 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800143 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800144 "EventLog/EventLog.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800145 "FrameTracker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146 "Layer.cpp",
147 "LayerProtoHelper.cpp",
148 "LayerRejecter.cpp",
149 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800150 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700151 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700152 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800153 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700154 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700155 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700156 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700157 "Scheduler/EventControlThread.cpp",
158 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700159 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100160 "Scheduler/LayerHistory.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700161 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700162 "Scheduler/MessageQueue.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700163 "Scheduler/PhaseOffsets.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700164 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100165 "Scheduler/SchedulerUtils.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700166 "Scheduler/VSyncModulator.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800167 "StartPropertySetThread.cpp",
168 "SurfaceFlinger.cpp",
169 "SurfaceInterceptor.cpp",
170 "SurfaceTracing.cpp",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700171 "TimeStats/TimeStats.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700172 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800173 ],
174}
175
176cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700177 // Please use libsurfaceflinger_defaults to configure how the sources are
178 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800179 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700180 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800181 srcs: [
182 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700183
184 // Note: SurfaceFlingerFactory is not in the default sources so that it
185 // can be easily replaced.
186 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800187 ],
mamik94e91f62019-08-19 09:11:33 -0700188 cflags: [
189 "-DUSE_VR_COMPOSER=1",
190 ],
191 // VrComposer is not used when building surfaceflinger for vendors
192 target: {
193 vendor: {
194 cflags: [
195 "-DUSE_VR_COMPOSER=0",
196 ],
197 },
198 },
Lloyd Piquef58625d2017-12-19 13:22:33 -0800199 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800200}
201
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700202cc_defaults {
203 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800204 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700205 cflags: [
206 "-DLOG_TAG=\"SurfaceFlinger\"",
207 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800208 shared_libs: [
209 "android.frameworks.displayservice@1.0",
210 "android.hardware.configstore-utils",
211 "android.hardware.configstore@1.0",
212 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800213 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800214 "libbinder",
215 "libcutils",
216 "libdisplayservicehidl",
217 "libhidlbase",
218 "libhidltransport",
Robert Carr720e5062018-07-30 17:45:14 -0700219 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800220 "liblayers_proto",
221 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700222 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800223 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700224 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800225 "libutils",
226 ],
227 static_libs: [
228 "libserviceutils",
229 "libtrace_proto",
230 ],
231 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700232}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800233
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700234filegroup {
235 name: "surfaceflinger_binary_sources",
236 srcs: ["main_surfaceflinger.cpp"],
237}
238
239cc_binary {
240 name: "surfaceflinger",
241 defaults: ["libsurfaceflinger_binary"],
242 init_rc: ["surfaceflinger.rc"],
243 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900244 shared_libs: [
245 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900246 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900247 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800248}
249
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800250subdirs = [
251 "layerproto",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700252 "TimeStats/timestatsproto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800253 "tests",
254]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900255
256cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900257 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900258 srcs: [
259 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900260 ],
261 shared_libs: [
262 "android.hardware.configstore-utils",
263 "android.hardware.configstore@1.0",
264 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900265 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900266 "libhidlbase",
267 "libhidltransport",
268 "libhwbinder",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900269 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900270 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900271 "liblog",
272 ],
273 static_libs: [
274 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900275 ],
276 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900277 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900278 "libhidlbase",
279 "libhidltransport",
280 "libhwbinder",
281 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900282 export_static_lib_headers: [
283 "SurfaceFlingerProperties",
284 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900285}