blob: 0e75d7fe4c93d6dcf9305e81c17e3f27ffecfb88 [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",
Marissa Walle2ffb422018-10-12 11:33:52 -0700156 "TransactionCompletedThread.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800157 ],
158}
159
160cc_library_shared {
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700161 // Please use libsurfaceflinger_defaults to configure how the sources are
162 // built, so the same settings can be used elsewhere.
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800163 name: "libsurfaceflinger",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700164 defaults: ["libsurfaceflinger_production_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800165 srcs: [
166 ":libsurfaceflinger_sources",
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700167
168 // Note: SurfaceFlingerFactory is not in the default sources so that it
169 // can be easily replaced.
170 "SurfaceFlingerFactory.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800171 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800172 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800173}
174
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700175cc_defaults {
176 name: "libsurfaceflinger_binary",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800177 defaults: ["surfaceflinger_defaults"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800178 whole_static_libs: [
179 "libsigchain",
180 ],
181 shared_libs: [
182 "android.frameworks.displayservice@1.0",
183 "android.hardware.configstore-utils",
184 "android.hardware.configstore@1.0",
Peiyong Lin13effd12018-07-24 17:01:47 -0700185 "android.hardware.configstore@1.2",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800186 "android.hardware.graphics.allocator@2.0",
187 "libbinder",
188 "libcutils",
189 "libdisplayservicehidl",
190 "libhidlbase",
191 "libhidltransport",
192 "liblayers_proto",
193 "liblog",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700194 "libtimestats_proto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800195 "libutils",
196 ],
197 static_libs: [
198 "libserviceutils",
199 "libtrace_proto",
200 ],
201 ldflags: ["-Wl,--export-dynamic"],
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700202}
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800203
Lloyd Piqueea0a5fb2018-09-12 15:04:56 -0700204filegroup {
205 name: "surfaceflinger_binary_sources",
206 srcs: ["main_surfaceflinger.cpp"],
207}
208
209cc_binary {
210 name: "surfaceflinger",
211 defaults: ["libsurfaceflinger_binary"],
212 init_rc: ["surfaceflinger.rc"],
213 srcs: [":surfaceflinger_binary_sources"],
214 shared_libs: ["libsurfaceflinger"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800215}
216
217cc_library_shared {
218 name: "libsurfaceflinger_ddmconnection",
219 defaults: ["surfaceflinger_defaults"],
220 srcs: ["DdmConnection.cpp"],
221 shared_libs: [
222 "libcutils",
223 "libdl",
224 "liblog",
225 ],
226 product_variables: {
227 // uses jni which may not be available in PDK
228 pdk: {
229 enabled: false,
230 },
231 },
232}
233
234subdirs = [
235 "layerproto",
Yiwei Zhangfaf3ded2018-05-02 17:37:17 -0700236 "TimeStats/timestatsproto",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800237 "tests",
238]