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