blob: b404836d99753b4f010a20e1f2302e4e9177442a [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",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080046 "liblayers_proto",
47 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090048 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080049 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070050 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080051 "libprotobuf-cpp-lite",
52 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -070053 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080054 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070055 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080056 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090057 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080058 ],
mamik94e91f62019-08-19 09:11:33 -070059 // VrComposer is not used when building surfaceflinger for vendors
60 target: {
61 vendor: {
62 exclude_shared_libs: [
63 "android.frameworks.vr.composer@2.0",
64 ],
65 },
66 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -080067 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070068 "libcompositionengine",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070069 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070070 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080071 "libserviceutils",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070072 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080073 "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",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070086 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080087 ],
88 export_shared_lib_headers: [
89 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080090 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070091 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080092 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070093 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070094 "android.hardware.graphics.composer@2.3",
Michael Wright5d22d4f2018-06-21 02:50:34 +010095 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080096 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080097 ],
98}
99
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700100cc_defaults {
101 name: "libsurfaceflinger_production_defaults",
102 defaults: ["libsurfaceflinger_defaults"],
103 cflags: [
104 "-fvisibility=hidden",
105 "-fwhole-program-vtables", // requires ThinLTO
106 ],
107 lto: {
108 thin: true,
109 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700110 // TODO(b/131771163): Fix broken fuzzer support with LTO.
111 sanitize: {
112 fuzzer: false,
113 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700114}
115
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800116cc_library_headers {
117 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800118 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800119 static_libs: ["libserviceutils"],
120 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800121}
Kalle Raitaa099a242017-01-11 11:17:29 -0800122
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800123filegroup {
124 name: "libsurfaceflinger_sources",
125 srcs: [
126 "BufferLayer.cpp",
127 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700128 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700129 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700130 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800131 "Client.cpp",
132 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800133 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800134 "DisplayDevice.cpp",
135 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700136 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800137 "DisplayHardware/FramebufferSurface.cpp",
138 "DisplayHardware/HWC2.cpp",
139 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100140 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800141 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800143 "EventLog/EventLog.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700144 "FrameTracer/FrameTracer.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",
Marissa Walle2ffb422018-10-12 11:33:52 -0700171 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800172 ],
173}
174
175cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700176 // Please use libsurfaceflinger_defaults to configure how the sources are
177 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800178 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700179 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800180 srcs: [
181 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700182
183 // Note: SurfaceFlingerFactory is not in the default sources so that it
184 // can be easily replaced.
185 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800186 ],
mamik94e91f62019-08-19 09:11:33 -0700187 cflags: [
188 "-DUSE_VR_COMPOSER=1",
189 ],
190 // VrComposer is not used when building surfaceflinger for vendors
191 target: {
192 vendor: {
193 cflags: [
194 "-DUSE_VR_COMPOSER=0",
195 ],
196 },
197 },
Lloyd Piquef58625d2017-12-19 13:22:33 -0800198 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800199}
200
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700201cc_defaults {
202 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800203 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700204 cflags: [
205 "-DLOG_TAG=\"SurfaceFlinger\"",
206 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800207 shared_libs: [
208 "android.frameworks.displayservice@1.0",
209 "android.hardware.configstore-utils",
210 "android.hardware.configstore@1.0",
211 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800212 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800213 "libbinder",
214 "libcutils",
215 "libdisplayservicehidl",
216 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700217 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800218 "liblayers_proto",
219 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700220 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800221 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700222 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800223 "libutils",
224 ],
225 static_libs: [
226 "libserviceutils",
227 "libtrace_proto",
228 ],
229 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700230}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800231
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700232filegroup {
233 name: "surfaceflinger_binary_sources",
234 srcs: ["main_surfaceflinger.cpp"],
235}
236
237cc_binary {
238 name: "surfaceflinger",
239 defaults: ["libsurfaceflinger_binary"],
240 init_rc: ["surfaceflinger.rc"],
241 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900242 shared_libs: [
243 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900244 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900245 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800246}
247
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800248subdirs = [
249 "layerproto",
250 "tests",
251]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900252
253cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900254 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900255 srcs: [
256 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900257 ],
258 shared_libs: [
259 "android.hardware.configstore-utils",
260 "android.hardware.configstore@1.0",
261 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900262 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900263 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900264 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900265 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900266 "liblog",
267 ],
268 static_libs: [
269 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900270 ],
271 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900272 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900273 "libhidlbase",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900274 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900275 export_static_lib_headers: [
276 "SurfaceFlingerProperties",
277 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900278}