blob: 4b71bd8d84c8cfc15da123e4f5d35e8469fe6206 [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",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070032 "android.hardware.graphics.composer@2.4",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080033 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010034 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080035 "libbase",
36 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080037 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080038 "libcutils",
39 "libdl",
40 "libEGL",
41 "libfmq",
42 "libGLESv1_CM",
43 "libGLESv2",
44 "libgui",
45 "libhardware",
46 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080047 "liblayers_proto",
48 "liblog",
Inseob Kimd6e835b2019-02-14 12:33:30 +090049 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080050 "libpdx_default_transport",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070051 "libprocessgroup",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080052 "libprotobuf-cpp-lite",
53 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -070054 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080055 "libui",
Robert Carr720e5062018-07-30 17:45:14 -070056 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080057 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +090058 "libSurfaceFlingerProp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080059 ],
mamik94e91f62019-08-19 09:11:33 -070060 // VrComposer is not used when building surfaceflinger for vendors
61 target: {
62 vendor: {
63 exclude_shared_libs: [
64 "android.frameworks.vr.composer@2.0",
65 ],
66 },
67 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -080068 static_libs: [
Lloyd Pique70d91362018-10-18 16:02:55 -070069 "libcompositionengine",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070070 "libperfetto_client_experimental",
Peiyong Lincbc184f2018-08-22 13:24:10 -070071 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080072 "libserviceutils",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070073 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080074 "libtrace_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080075 "libvr_manager",
76 "libvrflinger",
77 ],
78 header_libs: [
79 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070080 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070081 "android.hardware.graphics.composer@2.3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080082 ],
83 export_static_lib_headers: [
Lloyd Pique70d91362018-10-18 16:02:55 -070084 "libcompositionengine",
Peiyong Lincbc184f2018-08-22 13:24:10 -070085 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080086 "libserviceutils",
Mikael Pessa2e1608f2019-07-19 11:25:35 -070087 "libtimestats",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080088 ],
89 export_shared_lib_headers: [
90 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -080091 "android.hardware.graphics.allocator@3.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070092 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080093 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070094 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070095 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070096 "android.hardware.graphics.composer@2.4",
Michael Wright5d22d4f2018-06-21 02:50:34 +010097 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080098 "libhidlbase",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080099 ],
100}
101
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700102cc_defaults {
103 name: "libsurfaceflinger_production_defaults",
104 defaults: ["libsurfaceflinger_defaults"],
105 cflags: [
106 "-fvisibility=hidden",
107 "-fwhole-program-vtables", // requires ThinLTO
108 ],
109 lto: {
110 thin: true,
111 },
Mitch Phillipsc2049af2019-05-14 13:08:29 -0700112 // TODO(b/131771163): Fix broken fuzzer support with LTO.
113 sanitize: {
114 fuzzer: false,
115 },
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700116}
117
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800118cc_library_headers {
119 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800120 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800121 static_libs: ["libserviceutils"],
122 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800123}
Kalle Raitaa099a242017-01-11 11:17:29 -0800124
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800125filegroup {
126 name: "libsurfaceflinger_sources",
127 srcs: [
128 "BufferLayer.cpp",
129 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700130 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700131 "BufferStateLayer.cpp",
Marissa Wall947d34e2019-03-29 14:03:53 -0700132 "ClientCache.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800133 "Client.cpp",
134 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800135 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800136 "DisplayDevice.cpp",
137 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700138 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139 "DisplayHardware/FramebufferSurface.cpp",
140 "DisplayHardware/HWC2.cpp",
141 "DisplayHardware/HWComposer.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100142 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800143 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800144 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800145 "EventLog/EventLog.cpp",
Mikael Pessa90092f42019-08-26 17:22:04 -0700146 "FrameTracer/FrameTracer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800147 "FrameTracker.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800148 "Layer.cpp",
149 "LayerProtoHelper.cpp",
150 "LayerRejecter.cpp",
151 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800152 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700153 "NativeWindowSurface.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700154 "RefreshRateOverlay.cpp",
Dan Stozaec460082018-12-17 15:35:09 -0800155 "RegionSamplingThread.cpp",
Ady Abraham03b02dd2019-03-21 15:40:11 -0700156 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700157 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700158 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700159 "Scheduler/EventControlThread.cpp",
160 "Scheduler/EventThread.cpp",
Ana Krulecf2c006d2019-06-21 15:37:07 -0700161 "Scheduler/OneShotTimer.cpp",
Ana Krulec61f86db2018-11-19 14:16:35 +0100162 "Scheduler/LayerHistory.cpp",
Ady Abraham09bd3922019-04-08 10:44:56 -0700163 "Scheduler/LayerInfo.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700164 "Scheduler/MessageQueue.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700165 "Scheduler/PhaseOffsets.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700166 "Scheduler/Scheduler.cpp",
Ana Krulec434c22d2018-11-28 13:48:36 +0100167 "Scheduler/SchedulerUtils.cpp",
Kevin DuBoiscc27b502019-11-13 09:40:07 -0800168 "Scheduler/Timer.cpp",
Kevin DuBois1678e2c2019-08-22 12:26:24 -0700169 "Scheduler/VSyncDispatchTimerQueue.cpp",
170 "Scheduler/VSyncPredictor.cpp",
Alec Mourib488afa2019-05-23 10:22:24 -0700171 "Scheduler/VSyncModulator.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800172 "StartPropertySetThread.cpp",
173 "SurfaceFlinger.cpp",
Lloyd Pique24f3bfe2019-10-02 19:29:10 -0700174 "SurfaceFlingerDefaultFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800175 "SurfaceInterceptor.cpp",
176 "SurfaceTracing.cpp",
Marissa Walle2ffb422018-10-12 11:33:52 -0700177 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800178 ],
179}
180
181cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700182 // Please use libsurfaceflinger_defaults to configure how the sources are
183 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800184 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700185 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800186 srcs: [
187 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700188
189 // Note: SurfaceFlingerFactory is not in the default sources so that it
190 // can be easily replaced.
191 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800192 ],
mamik94e91f62019-08-19 09:11:33 -0700193 cflags: [
194 "-DUSE_VR_COMPOSER=1",
195 ],
196 // VrComposer is not used when building surfaceflinger for vendors
197 target: {
198 vendor: {
199 cflags: [
200 "-DUSE_VR_COMPOSER=0",
201 ],
202 },
203 },
Lloyd Piquef58625d2017-12-19 13:22:33 -0800204 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800205}
206
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700207cc_defaults {
208 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800209 defaults: ["surfaceflinger_defaults"],
Lloyd Pique70d91362018-10-18 16:02:55 -0700210 cflags: [
211 "-DLOG_TAG=\"SurfaceFlinger\"",
212 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800213 shared_libs: [
214 "android.frameworks.displayservice@1.0",
215 "android.hardware.configstore-utils",
216 "android.hardware.configstore@1.0",
217 "android.hardware.graphics.allocator@2.0",
Marissa Wall925bf7f2018-12-29 14:27:11 -0800218 "android.hardware.graphics.allocator@3.0",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800219 "libbinder",
220 "libcutils",
221 "libdisplayservicehidl",
222 "libhidlbase",
Robert Carr720e5062018-07-30 17:45:14 -0700223 "libinput",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800224 "liblayers_proto",
225 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700226 "libprocessgroup",
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800227 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700228 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800229 "libutils",
230 ],
231 static_libs: [
232 "libserviceutils",
233 "libtrace_proto",
234 ],
235 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700236}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800237
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700238filegroup {
239 name: "surfaceflinger_binary_sources",
240 srcs: ["main_surfaceflinger.cpp"],
241}
242
243cc_binary {
244 name: "surfaceflinger",
245 defaults: ["libsurfaceflinger_binary"],
246 init_rc: ["surfaceflinger.rc"],
247 srcs: [":surfaceflinger_binary_sources"],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900248 shared_libs: [
249 "libsurfaceflinger",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900250 "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900251 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800252}
253
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800254subdirs = [
255 "layerproto",
256 "tests",
257]
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900258
259cc_library_shared {
Inseob Kimd6e835b2019-02-14 12:33:30 +0900260 name: "libSurfaceFlingerProp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900261 srcs: [
262 "SurfaceFlingerProperties.cpp",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900263 ],
264 shared_libs: [
265 "android.hardware.configstore-utils",
266 "android.hardware.configstore@1.0",
267 "android.hardware.configstore@1.1",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900268 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900269 "libhidlbase",
Sundong Ahncb20cca2019-02-22 11:57:38 +0900270 "libui",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900271 "libutils",
Inseob Kimd6e835b2019-02-14 12:33:30 +0900272 "liblog",
273 ],
274 static_libs: [
275 "SurfaceFlingerProperties",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900276 ],
277 export_shared_lib_headers: [
Sundong Ahncb20cca2019-02-22 11:57:38 +0900278 "android.hardware.graphics.common@1.2",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900279 "libhidlbase",
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900280 ],
Inseob Kimd6e835b2019-02-14 12:33:30 +0900281 export_static_lib_headers: [
282 "SurfaceFlingerProperties",
283 ],
Sundong Ahnd5e08f62018-12-12 20:27:28 +0900284}