blob: 339f83b5f009334603a74b7ff698f61f4cc0225d [file] [log] [blame]
Lloyd Pique66ce40d2018-01-23 16:42:19 -08001cc_defaults {
2 name: "surfaceflinger_defaults",
3 cflags: [
4 "-DLOG_TAG=\"SurfaceFlinger\"",
5 "-Wall",
6 "-Werror",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -07007 "-Wformat",
Lloyd Pique755e3192018-01-31 16:46:15 -08008 "-Wthread-safety",
Lloyd Pique66ce40d2018-01-23 16:42:19 -08009 "-Wunused",
10 "-Wunreachable-code",
11 ],
12 cppflags: ["-std=c++1z"],
13}
14
15cc_defaults {
16 name: "libsurfaceflinger_defaults",
17 defaults: ["surfaceflinger_defaults"],
18 cflags: [
19 "-DGL_GLEXT_PROTOTYPES",
20 "-DEGL_EGLEXT_PROTOTYPES",
21 ],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -070022 include_dirs: [
23 "frameworks/native/vulkan/vkjson",
24 "frameworks/native/vulkan/include",
25 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080026 shared_libs: [
27 "android.frameworks.vr.composer@1.0",
28 "android.hardware.configstore-utils",
29 "android.hardware.configstore@1.0",
Iris Chang7501ed62018-04-30 14:45:42 +080030 "android.hardware.configstore@1.1",
Peiyong Lin13effd12018-07-24 17:01:47 -070031 "android.hardware.configstore@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080032 "android.hardware.graphics.allocator@2.0",
33 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070034 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070035 "android.hardware.graphics.composer@2.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080036 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010037 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080038 "libbase",
39 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080040 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080041 "libcutils",
42 "libdl",
43 "libEGL",
44 "libfmq",
45 "libGLESv1_CM",
46 "libGLESv2",
47 "libgui",
48 "libhardware",
49 "libhidlbase",
50 "libhidltransport",
51 "libhwbinder",
52 "liblayers_proto",
53 "liblog",
Alec Mouri05483a02018-09-10 21:03:42 +000054 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080055 "libpdx_default_transport",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080056 "libprotobuf-cpp-lite",
57 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -070058 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080059 "libui",
60 "libutils",
61 "libvulkan",
62 ],
63 static_libs: [
Peiyong Lincbc184f2018-08-22 13:24:10 -070064 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080065 "libserviceutils",
66 "libtrace_proto",
67 "libvkjson",
68 "libvr_manager",
69 "libvrflinger",
70 ],
71 header_libs: [
72 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070073 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070074 "android.hardware.graphics.composer@2.3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080075 ],
76 export_static_lib_headers: [
Peiyong Lincbc184f2018-08-22 13:24:10 -070077 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080078 "libserviceutils",
79 ],
80 export_shared_lib_headers: [
81 "android.hardware.graphics.allocator@2.0",
82 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070083 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070084 "android.hardware.graphics.composer@2.3",
Michael Wright5d22d4f2018-06-21 02:50:34 +010085 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080086 "libhidlbase",
87 "libhidltransport",
88 "libhwbinder",
89 ],
90}
91
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -070092cc_defaults {
93 name: "libsurfaceflinger_production_defaults",
94 defaults: ["libsurfaceflinger_defaults"],
95 cflags: [
96 "-fvisibility=hidden",
97 "-fwhole-program-vtables", // requires ThinLTO
98 ],
99 lto: {
100 thin: true,
101 },
102}
103
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800104cc_library_headers {
105 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800106 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800107 static_libs: ["libserviceutils"],
108 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800109}
Kalle Raitaa099a242017-01-11 11:17:29 -0800110
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800111filegroup {
112 name: "libsurfaceflinger_sources",
113 srcs: [
114 "BufferLayer.cpp",
115 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700116 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700117 "BufferStateLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800118 "Client.cpp",
119 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800120 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800121 "DisplayDevice.cpp",
122 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700123 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800124 "DisplayHardware/FramebufferSurface.cpp",
125 "DisplayHardware/HWC2.cpp",
126 "DisplayHardware/HWComposer.cpp",
127 "DisplayHardware/HWComposerBufferCache.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100128 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800129 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800130 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800131 "EventLog/EventLog.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800132 "FrameTracker.cpp",
133 "GpuService.cpp",
134 "Layer.cpp",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700135 "LayerBE.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800136 "LayerProtoHelper.cpp",
137 "LayerRejecter.cpp",
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800138 "LayerStats.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800139 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800140 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700141 "NativeWindowSurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700143 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700144 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700145 "Scheduler/EventControlThread.cpp",
146 "Scheduler/EventThread.cpp",
147 "Scheduler/MessageQueue.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700148 "Scheduler/Scheduler.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800149 "StartPropertySetThread.cpp",
150 "SurfaceFlinger.cpp",
151 "SurfaceInterceptor.cpp",
152 "SurfaceTracing.cpp",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700153 "TimeStats/TimeStats.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800154 ],
155}
156
157cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700158 // Please use libsurfaceflinger_defaults to configure how the sources are
159 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800160 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700161 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800162 srcs: [
163 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700164
165 // Note: SurfaceFlingerFactory is not in the default sources so that it
166 // can be easily replaced.
167 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800168 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800169 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800170}
171
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700172cc_defaults {
173 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800174 defaults: ["surfaceflinger_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800175 whole_static_libs: [
176 "libsigchain",
177 ],
178 shared_libs: [
179 "android.frameworks.displayservice@1.0",
180 "android.hardware.configstore-utils",
181 "android.hardware.configstore@1.0",
Peiyong Lin13effd12018-07-24 17:01:47 -0700182 "android.hardware.configstore@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800183 "android.hardware.graphics.allocator@2.0",
184 "libbinder",
185 "libcutils",
186 "libdisplayservicehidl",
187 "libhidlbase",
188 "libhidltransport",
189 "liblayers_proto",
190 "liblog",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700191 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800192 "libutils",
193 ],
194 static_libs: [
195 "libserviceutils",
196 "libtrace_proto",
197 ],
198 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700199}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800200
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700201filegroup {
202 name: "surfaceflinger_binary_sources",
203 srcs: ["main_surfaceflinger.cpp"],
204}
205
206cc_binary {
207 name: "surfaceflinger",
208 defaults: ["libsurfaceflinger_binary"],
209 init_rc: ["surfaceflinger.rc"],
210 srcs: [":surfaceflinger_binary_sources"],
211 shared_libs: ["libsurfaceflinger"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800212}
213
214cc_library_shared {
215 name: "libsurfaceflinger_ddmconnection",
216 defaults: ["surfaceflinger_defaults"],
217 srcs: ["DdmConnection.cpp"],
218 shared_libs: [
219 "libcutils",
220 "libdl",
221 "liblog",
222 ],
223 product_variables: {
224 // uses jni which may not be available in PDK
225 pdk: {
226 enabled: false,
227 },
228 },
229}
230
231subdirs = [
232 "layerproto",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700233 "TimeStats/timestatsproto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800234 "tests",
235]