blob: 16003a258ce5301f966703faa1e8c7577e170967 [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",
Valerie Hau9758ae02018-10-09 16:05:09 -070033 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080034 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070035 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070036 "android.hardware.graphics.composer@2.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080037 "android.hardware.power@1.0",
Michael Wright5d22d4f2018-06-21 02:50:34 +010038 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080039 "libbase",
40 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080041 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080042 "libcutils",
43 "libdl",
44 "libEGL",
45 "libfmq",
46 "libGLESv1_CM",
47 "libGLESv2",
48 "libgui",
49 "libhardware",
50 "libhidlbase",
51 "libhidltransport",
52 "libhwbinder",
53 "liblayers_proto",
54 "liblog",
Alec Mouri05483a02018-09-10 21:03:42 +000055 "libnativewindow",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080056 "libpdx_default_transport",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080057 "libprotobuf-cpp-lite",
58 "libsync",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -070059 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080060 "libui",
61 "libutils",
62 "libvulkan",
63 ],
64 static_libs: [
Peiyong Lincbc184f2018-08-22 13:24:10 -070065 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080066 "libserviceutils",
67 "libtrace_proto",
68 "libvkjson",
69 "libvr_manager",
70 "libvrflinger",
71 ],
72 header_libs: [
73 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070074 "android.hardware.graphics.composer@2.2-command-buffer",
Peiyong Lin698147a2018-09-14 13:27:18 -070075 "android.hardware.graphics.composer@2.3-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080076 ],
77 export_static_lib_headers: [
Peiyong Lincbc184f2018-08-22 13:24:10 -070078 "librenderengine",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080079 "libserviceutils",
80 ],
81 export_shared_lib_headers: [
82 "android.hardware.graphics.allocator@2.0",
Valerie Hau9758ae02018-10-09 16:05:09 -070083 "android.hardware.graphics.common@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080084 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070085 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070086 "android.hardware.graphics.composer@2.3",
Michael Wright5d22d4f2018-06-21 02:50:34 +010087 "android.hardware.power@1.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080088 "libhidlbase",
89 "libhidltransport",
90 "libhwbinder",
91 ],
92}
93
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -070094cc_defaults {
95 name: "libsurfaceflinger_production_defaults",
96 defaults: ["libsurfaceflinger_defaults"],
97 cflags: [
98 "-fvisibility=hidden",
99 "-fwhole-program-vtables", // requires ThinLTO
100 ],
101 lto: {
102 thin: true,
103 },
104}
105
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800106cc_library_headers {
107 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -0800108 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +0800109 static_libs: ["libserviceutils"],
110 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -0800111}
Kalle Raitaa099a242017-01-11 11:17:29 -0800112
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800113filegroup {
114 name: "libsurfaceflinger_sources",
115 srcs: [
116 "BufferLayer.cpp",
117 "BufferLayerConsumer.cpp",
Marissa Wallfd668622018-05-10 10:21:13 -0700118 "BufferQueueLayer.cpp",
Marissa Wall61c58622018-07-18 10:12:20 -0700119 "BufferStateLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800120 "Client.cpp",
121 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -0800122 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800123 "DisplayDevice.cpp",
124 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -0700125 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800126 "DisplayHardware/FramebufferSurface.cpp",
127 "DisplayHardware/HWC2.cpp",
128 "DisplayHardware/HWComposer.cpp",
129 "DisplayHardware/HWComposerBufferCache.cpp",
Michael Wright5d22d4f2018-06-21 02:50:34 +0100130 "DisplayHardware/PowerAdvisor.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800131 "DisplayHardware/VirtualDisplaySurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800132 "Effects/Daltonizer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800133 "EventLog/EventLog.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800134 "FrameTracker.cpp",
135 "GpuService.cpp",
136 "Layer.cpp",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700137 "LayerBE.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800138 "LayerProtoHelper.cpp",
139 "LayerRejecter.cpp",
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800140 "LayerStats.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800141 "LayerVector.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800142 "MonitoredProducer.cpp",
Lloyd Pique22098362018-09-13 11:46:49 -0700143 "NativeWindowSurface.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800144 "RenderArea.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700145 "Scheduler/DispSync.cpp",
Ana Krulec241cf832018-08-10 15:03:23 -0700146 "Scheduler/DispSyncSource.cpp",
Ana Krulecfefcb582018-08-07 14:22:37 -0700147 "Scheduler/EventControlThread.cpp",
148 "Scheduler/EventThread.cpp",
149 "Scheduler/MessageQueue.cpp",
Ana Krulec98b5b242018-08-10 15:03:23 -0700150 "Scheduler/Scheduler.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800151 "StartPropertySetThread.cpp",
152 "SurfaceFlinger.cpp",
153 "SurfaceInterceptor.cpp",
154 "SurfaceTracing.cpp",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700155 "TimeStats/TimeStats.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800156 ],
157}
158
159cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700160 // Please use libsurfaceflinger_defaults to configure how the sources are
161 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800162 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700163 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800164 srcs: [
165 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700166
167 // Note: SurfaceFlingerFactory is not in the default sources so that it
168 // can be easily replaced.
169 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800170 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800171 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800172}
173
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700174cc_defaults {
175 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800176 defaults: ["surfaceflinger_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800177 whole_static_libs: [
178 "libsigchain",
179 ],
180 shared_libs: [
181 "android.frameworks.displayservice@1.0",
182 "android.hardware.configstore-utils",
183 "android.hardware.configstore@1.0",
Peiyong Lin13effd12018-07-24 17:01:47 -0700184 "android.hardware.configstore@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800185 "android.hardware.graphics.allocator@2.0",
186 "libbinder",
187 "libcutils",
188 "libdisplayservicehidl",
189 "libhidlbase",
190 "libhidltransport",
191 "liblayers_proto",
192 "liblog",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700193 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800194 "libutils",
195 ],
196 static_libs: [
197 "libserviceutils",
198 "libtrace_proto",
199 ],
200 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700201}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800202
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700203filegroup {
204 name: "surfaceflinger_binary_sources",
205 srcs: ["main_surfaceflinger.cpp"],
206}
207
208cc_binary {
209 name: "surfaceflinger",
210 defaults: ["libsurfaceflinger_binary"],
211 init_rc: ["surfaceflinger.rc"],
212 srcs: [":surfaceflinger_binary_sources"],
213 shared_libs: ["libsurfaceflinger"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800214}
215
216cc_library_shared {
217 name: "libsurfaceflinger_ddmconnection",
218 defaults: ["surfaceflinger_defaults"],
219 srcs: ["DdmConnection.cpp"],
220 shared_libs: [
221 "libcutils",
222 "libdl",
223 "liblog",
224 ],
225 product_variables: {
226 // uses jni which may not be available in PDK
227 pdk: {
228 enabled: false,
229 },
230 },
231}
232
233subdirs = [
234 "layerproto",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700235 "TimeStats/timestatsproto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800236 "tests",
237]