blob: 6ffef3175efe6b7147dc9cfdd749446dfea374be [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 Pique755e3192018-01-31 16:46:15 -08007 "-Wthread-safety",
Lloyd Pique66ce40d2018-01-23 16:42:19 -08008 "-Wunused",
9 "-Wunreachable-code",
10 ],
11 cppflags: ["-std=c++1z"],
12}
13
14cc_defaults {
15 name: "libsurfaceflinger_defaults",
16 defaults: ["surfaceflinger_defaults"],
17 cflags: [
18 "-DGL_GLEXT_PROTOTYPES",
19 "-DEGL_EGLEXT_PROTOTYPES",
20 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080021 shared_libs: [
22 "android.frameworks.vr.composer@1.0",
23 "android.hardware.configstore-utils",
24 "android.hardware.configstore@1.0",
25 "android.hardware.graphics.allocator@2.0",
26 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070027 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070028 "android.hardware.graphics.composer@2.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080029 "android.hardware.power@1.0",
30 "libbase",
31 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080032 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080033 "libcutils",
34 "libdl",
35 "libEGL",
36 "libfmq",
37 "libGLESv1_CM",
38 "libGLESv2",
39 "libgui",
40 "libhardware",
41 "libhidlbase",
42 "libhidltransport",
43 "libhwbinder",
44 "liblayers_proto",
45 "liblog",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080046 "libpdx_default_transport",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080047 "libprotobuf-cpp-lite",
48 "libsync",
49 "libui",
50 "libutils",
51 "libvulkan",
52 ],
53 static_libs: [
54 "libserviceutils",
55 "libtrace_proto",
56 "libvkjson",
57 "libvr_manager",
58 "libvrflinger",
59 ],
60 header_libs: [
61 "android.hardware.graphics.composer@2.1-command-buffer",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070062 "android.hardware.graphics.composer@2.2-command-buffer",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080063 ],
64 export_static_lib_headers: [
65 "libserviceutils",
66 ],
67 export_shared_lib_headers: [
68 "android.hardware.graphics.allocator@2.0",
69 "android.hardware.graphics.composer@2.1",
Courtney Goeltzenleuchterf9c98e52018-02-12 07:23:17 -070070 "android.hardware.graphics.composer@2.2",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070071 "android.hardware.graphics.composer@2.3",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080072 "libhidlbase",
73 "libhidltransport",
74 "libhwbinder",
75 ],
76}
77
78cc_library_headers {
79 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -080080 export_include_dirs: ["."],
Logan Chien3ac6c962018-02-27 16:46:00 +080081 static_libs: ["libserviceutils"],
82 export_static_lib_headers: ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -080083}
Kalle Raitaa099a242017-01-11 11:17:29 -080084
Lloyd Pique66ce40d2018-01-23 16:42:19 -080085filegroup {
86 name: "libsurfaceflinger_sources",
87 srcs: [
88 "BufferLayer.cpp",
89 "BufferLayerConsumer.cpp",
90 "Client.cpp",
91 "ColorLayer.cpp",
Robert Carrcdf83202018-03-07 12:48:34 -080092 "ContainerLayer.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080093 "DisplayDevice.cpp",
94 "DisplayHardware/ComposerHal.cpp",
Dominik Laskowskie9ef7c42018-03-12 19:34:30 -070095 "DisplayHardware/DisplayIdentification.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080096 "DisplayHardware/FramebufferSurface.cpp",
97 "DisplayHardware/HWC2.cpp",
98 "DisplayHardware/HWComposer.cpp",
99 "DisplayHardware/HWComposerBufferCache.cpp",
100 "DisplayHardware/VirtualDisplaySurface.cpp",
101 "DispSync.cpp",
102 "Effects/Daltonizer.cpp",
103 "EventControlThread.cpp",
104 "EventLog/EventLog.cpp",
105 "EventThread.cpp",
106 "FrameTracker.cpp",
107 "GpuService.cpp",
108 "Layer.cpp",
David Sodmanb8af7922017-12-21 15:17:55 -0800109 "LayerBE.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800110 "LayerProtoHelper.cpp",
111 "LayerRejecter.cpp",
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800112 "LayerStats.cpp",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800113 "LayerVector.cpp",
114 "MessageQueue.cpp",
115 "MonitoredProducer.cpp",
116 "RenderArea.cpp",
117 "RenderEngine/Description.cpp",
118 "RenderEngine/GLES20RenderEngine.cpp",
119 "RenderEngine/GLExtensions.cpp",
120 "RenderEngine/Image.cpp",
121 "RenderEngine/Mesh.cpp",
122 "RenderEngine/Program.cpp",
123 "RenderEngine/ProgramCache.cpp",
124 "RenderEngine/RenderEngine.cpp",
125 "RenderEngine/Surface.cpp",
126 "RenderEngine/Texture.cpp",
127 "StartPropertySetThread.cpp",
128 "SurfaceFlinger.cpp",
129 "SurfaceInterceptor.cpp",
130 "SurfaceTracing.cpp",
131 "Transform.cpp",
132 ],
133}
134
135cc_library_shared {
136 name: "libsurfaceflinger",
137 defaults: ["libsurfaceflinger_defaults"],
138 cflags: [
139 "-fvisibility=hidden",
140 "-Werror=format",
141 ],
142 srcs: [
143 ":libsurfaceflinger_sources",
144 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800145 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146 include_dirs: [
Yiwei Zhang66e01752018-04-24 14:16:09 -0700147 "frameworks/native/vulkan/vkjson",
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800148 "frameworks/native/vulkan/include",
149 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800150 cppflags: [
Logan Chien3ac6c962018-02-27 16:46:00 +0800151 "-fwhole-program-vtables", // requires ThinLTO
Lloyd Piquef58625d2017-12-19 13:22:33 -0800152 ],
153 lto: {
154 thin: true,
155 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800156}
157
158cc_binary {
159 name: "surfaceflinger",
160 defaults: ["surfaceflinger_defaults"],
161 init_rc: ["surfaceflinger.rc"],
162 srcs: ["main_surfaceflinger.cpp"],
163 whole_static_libs: [
164 "libsigchain",
165 ],
166 shared_libs: [
167 "android.frameworks.displayservice@1.0",
168 "android.hardware.configstore-utils",
169 "android.hardware.configstore@1.0",
170 "android.hardware.graphics.allocator@2.0",
171 "libbinder",
172 "libcutils",
173 "libdisplayservicehidl",
174 "libhidlbase",
175 "libhidltransport",
176 "liblayers_proto",
177 "liblog",
178 "libsurfaceflinger",
179 "libutils",
180 ],
181 static_libs: [
182 "libserviceutils",
183 "libtrace_proto",
184 ],
185 ldflags: ["-Wl,--export-dynamic"],
186
187 // TODO(b/71715793): These version-scripts are required due to the use of
188 // whole_static_libs to pull in libsigchain. To work, the files had to be
189 // locally duplicated from their original location
190 // $ANDROID_ROOT/art/sigchainlib/
191 multilib: {
192 lib32: {
193 version_script: "version-script32.txt",
194 },
195 lib64: {
196 version_script: "version-script64.txt",
197 },
198 },
199}
200
201cc_library_shared {
202 name: "libsurfaceflinger_ddmconnection",
203 defaults: ["surfaceflinger_defaults"],
204 srcs: ["DdmConnection.cpp"],
205 shared_libs: [
206 "libcutils",
207 "libdl",
208 "liblog",
209 ],
210 product_variables: {
211 // uses jni which may not be available in PDK
212 pdk: {
213 enabled: false,
214 },
215 },
216}
217
218subdirs = [
219 "layerproto",
220 "tests",
221]