blob: 08ec26bf584372eab71230df2db3cedf3e714dfc [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",
7 "-Wunused",
8 "-Wunreachable-code",
9 ],
10 cppflags: ["-std=c++1z"],
11}
12
13cc_defaults {
14 name: "libsurfaceflinger_defaults",
15 defaults: ["surfaceflinger_defaults"],
16 cflags: [
17 "-DGL_GLEXT_PROTOTYPES",
18 "-DEGL_EGLEXT_PROTOTYPES",
19 ],
Lloyd Pique66ce40d2018-01-23 16:42:19 -080020 shared_libs: [
21 "android.frameworks.vr.composer@1.0",
22 "android.hardware.configstore-utils",
23 "android.hardware.configstore@1.0",
24 "android.hardware.graphics.allocator@2.0",
25 "android.hardware.graphics.composer@2.1",
26 "android.hardware.power@1.0",
27 "libbase",
28 "libbinder",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080029 "libbufferhubqueue",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080030 "libcutils",
31 "libdl",
32 "libEGL",
33 "libfmq",
34 "libGLESv1_CM",
35 "libGLESv2",
36 "libgui",
37 "libhardware",
38 "libhidlbase",
39 "libhidltransport",
40 "libhwbinder",
41 "liblayers_proto",
42 "liblog",
Jiwen 'Steve' Cai037f35a2018-01-25 19:40:23 -080043 "libpdx_default_transport",
Lloyd Pique66ce40d2018-01-23 16:42:19 -080044 "libprotobuf-cpp-lite",
45 "libsync",
46 "libui",
47 "libutils",
48 "libvulkan",
49 ],
50 static_libs: [
51 "libserviceutils",
52 "libtrace_proto",
53 "libvkjson",
54 "libvr_manager",
55 "libvrflinger",
56 ],
57 header_libs: [
58 "android.hardware.graphics.composer@2.1-command-buffer",
59 ],
60 export_static_lib_headers: [
61 "libserviceutils",
62 ],
63 export_shared_lib_headers: [
64 "android.hardware.graphics.allocator@2.0",
65 "android.hardware.graphics.composer@2.1",
66 "libhidlbase",
67 "libhidltransport",
68 "libhwbinder",
69 ],
70}
71
72cc_library_headers {
73 name: "libsurfaceflinger_headers",
Alex Vakulenko06a76342017-02-01 22:25:44 -080074 export_include_dirs: ["."],
Vishnu Nair35798872017-10-06 16:00:36 -070075 static_libs = ["libserviceutils"],
76 export_static_lib_headers = ["libserviceutils"],
Alex Vakulenko06a76342017-02-01 22:25:44 -080077}
Kalle Raitaa099a242017-01-11 11:17:29 -080078
Lloyd Pique66ce40d2018-01-23 16:42:19 -080079filegroup {
80 name: "libsurfaceflinger_sources",
81 srcs: [
82 "BufferLayer.cpp",
83 "BufferLayerConsumer.cpp",
84 "Client.cpp",
85 "ColorLayer.cpp",
86 "DisplayDevice.cpp",
87 "DisplayHardware/ComposerHal.cpp",
88 "DisplayHardware/FramebufferSurface.cpp",
89 "DisplayHardware/HWC2.cpp",
90 "DisplayHardware/HWComposer.cpp",
91 "DisplayHardware/HWComposerBufferCache.cpp",
92 "DisplayHardware/VirtualDisplaySurface.cpp",
93 "DispSync.cpp",
94 "Effects/Daltonizer.cpp",
95 "EventControlThread.cpp",
96 "EventLog/EventLog.cpp",
97 "EventThread.cpp",
98 "FrameTracker.cpp",
99 "GpuService.cpp",
100 "Layer.cpp",
101 "LayerProtoHelper.cpp",
102 "LayerRejecter.cpp",
103 "LayerVector.cpp",
104 "MessageQueue.cpp",
105 "MonitoredProducer.cpp",
106 "RenderArea.cpp",
107 "RenderEngine/Description.cpp",
108 "RenderEngine/GLES20RenderEngine.cpp",
109 "RenderEngine/GLExtensions.cpp",
110 "RenderEngine/Image.cpp",
111 "RenderEngine/Mesh.cpp",
112 "RenderEngine/Program.cpp",
113 "RenderEngine/ProgramCache.cpp",
114 "RenderEngine/RenderEngine.cpp",
115 "RenderEngine/Surface.cpp",
116 "RenderEngine/Texture.cpp",
117 "StartPropertySetThread.cpp",
118 "SurfaceFlinger.cpp",
119 "SurfaceInterceptor.cpp",
120 "SurfaceTracing.cpp",
121 "Transform.cpp",
122 ],
123}
124
125cc_library_shared {
126 name: "libsurfaceflinger",
127 defaults: ["libsurfaceflinger_defaults"],
128 cflags: [
129 "-fvisibility=hidden",
130 "-Werror=format",
131 ],
132 srcs: [
133 ":libsurfaceflinger_sources",
134 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800135 logtags: ["EventLog/EventLogTags.logtags"],
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800136 include_dirs: [
137 "external/vulkan-validation-layers/libs/vkjson",
138 "frameworks/native/vulkan/include",
139 ],
Lloyd Piquef58625d2017-12-19 13:22:33 -0800140 cppflags: [
141 "-fwhole-program-vtables", // requires ThinLTO
142 ],
143 lto: {
144 thin: true,
145 },
Lloyd Pique66ce40d2018-01-23 16:42:19 -0800146}
147
148cc_binary {
149 name: "surfaceflinger",
150 defaults: ["surfaceflinger_defaults"],
151 init_rc: ["surfaceflinger.rc"],
152 srcs: ["main_surfaceflinger.cpp"],
153 whole_static_libs: [
154 "libsigchain",
155 ],
156 shared_libs: [
157 "android.frameworks.displayservice@1.0",
158 "android.hardware.configstore-utils",
159 "android.hardware.configstore@1.0",
160 "android.hardware.graphics.allocator@2.0",
161 "libbinder",
162 "libcutils",
163 "libdisplayservicehidl",
164 "libhidlbase",
165 "libhidltransport",
166 "liblayers_proto",
167 "liblog",
168 "libsurfaceflinger",
169 "libutils",
170 ],
171 static_libs: [
172 "libserviceutils",
173 "libtrace_proto",
174 ],
175 ldflags: ["-Wl,--export-dynamic"],
176
177 // TODO(b/71715793): These version-scripts are required due to the use of
178 // whole_static_libs to pull in libsigchain. To work, the files had to be
179 // locally duplicated from their original location
180 // $ANDROID_ROOT/art/sigchainlib/
181 multilib: {
182 lib32: {
183 version_script: "version-script32.txt",
184 },
185 lib64: {
186 version_script: "version-script64.txt",
187 },
188 },
189}
190
191cc_library_shared {
192 name: "libsurfaceflinger_ddmconnection",
193 defaults: ["surfaceflinger_defaults"],
194 srcs: ["DdmConnection.cpp"],
195 shared_libs: [
196 "libcutils",
197 "libdl",
198 "liblog",
199 ],
200 product_variables: {
201 // uses jni which may not be available in PDK
202 pdk: {
203 enabled: false,
204 },
205 },
206}
207
208subdirs = [
209 "layerproto",
210 "tests",
211]