blob: 91250b9945067c0f61f858a6601fab18e10419f2 [file] [log] [blame]
Dan Willemsen59e086f2016-07-25 17:13:45 -07001// Build the ETC1 library
Bob Badour3306e492021-02-25 15:35:37 -08002package {
3 // See: http://go/android-license-faq
4 // A large-scale-change added 'default_applicable_licenses' to import
5 // all of the 'license_kinds' from "frameworks_native_license"
6 // to get the below license kinds:
7 // SPDX-license-identifier-Apache-2.0
8 default_applicable_licenses: ["frameworks_native_license"],
9}
10
Dan Willemsen59e086f2016-07-25 17:13:45 -070011cc_library {
12 name: "libETC1",
13 srcs: ["ETC1/etc1.cpp"],
14 host_supported: true,
Spandan Das4a5e3f22022-09-08 21:49:51 +000015 cflags: [
16 "-Wall",
17 "-Werror",
18 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070019
20 target: {
21 android: {
22 static: {
23 enabled: false,
24 },
25 },
26 host: {
27 shared: {
28 enabled: false,
29 },
30 },
31 windows: {
32 enabled: true,
33 },
34 },
35}
Dan Albert49fbff42016-10-03 12:36:00 -070036
Dan Albert7facb1d2016-10-03 12:36:00 -070037// The headers modules are in frameworks/native/opengl/Android.bp.
Dan Albert49fbff42016-10-03 12:36:00 -070038ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070039 name: "libEGL",
Dan Albert49fbff42016-10-03 12:36:00 -070040 symbol_file: "libEGL.map.txt",
41 first_version: "9",
Dan Albertb9c62a62017-01-05 15:58:50 -080042 unversioned_until: "current",
Dan Albert49fbff42016-10-03 12:36:00 -070043}
Dan Albert7facb1d2016-10-03 12:36:00 -070044
45ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070046 name: "libGLESv1_CM",
Dan Albert7facb1d2016-10-03 12:36:00 -070047 symbol_file: "libGLESv1_CM.map.txt",
48 first_version: "9",
Dan Albertb9c62a62017-01-05 15:58:50 -080049 unversioned_until: "current",
Dan Albert7facb1d2016-10-03 12:36:00 -070050}
Dan Albert00500c72016-10-03 12:36:00 -070051
52ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070053 name: "libGLESv2",
Dan Albert00500c72016-10-03 12:36:00 -070054 symbol_file: "libGLESv2.map.txt",
55 first_version: "9",
Dan Albertb9c62a62017-01-05 15:58:50 -080056 unversioned_until: "current",
Dan Albert00500c72016-10-03 12:36:00 -070057}
Dan Albertd7d8efa2016-10-03 12:36:00 -070058
59ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070060 name: "libGLESv3",
Dan Albertd7d8efa2016-10-03 12:36:00 -070061 symbol_file: "libGLESv3.map.txt",
62 first_version: "18",
Dan Albertb9c62a62017-01-05 15:58:50 -080063 unversioned_until: "current",
Dan Albertd7d8efa2016-10-03 12:36:00 -070064}
Dan Willemsena3310632016-10-03 23:56:51 -070065
Cody Northrop4ee63862024-11-19 22:41:23 -070066aconfig_declarations {
67 name: "egl_flags",
68 package: "com.android.graphics.egl.flags",
69 container: "system",
70 srcs: ["EGL/egl_flags.aconfig"],
71}
72
73cc_aconfig_library {
74 name: "libegl_flags",
75 aconfig_declarations: "egl_flags",
76}
77
Dan Willemsena3310632016-10-03 23:56:51 -070078cc_defaults {
79 name: "gl_libs_defaults",
80 cflags: [
81 "-DGL_GLEXT_PROTOTYPES",
82 "-DEGL_EGLEXT_PROTOTYPES",
83 "-fvisibility=hidden",
Chih-Hung Hsiehc60a0f02017-10-05 14:25:18 -070084 "-Wall",
85 "-Werror",
86 "-Wno-unused-variable",
Dan Willemsena3310632016-10-03 23:56:51 -070087 ],
88 shared_libs: [
Mathias Agopian5f1af042017-03-09 18:50:05 -080089 // ***** DO NOT ADD NEW DEPENDENCIES HERE *****
90 // In particular, DO NOT add libutils or anything "above" libcutils
Dan Willemsena3310632016-10-03 23:56:51 -070091 "libcutils",
92 "liblog",
93 "libdl",
94 ],
Jiyong Parka243e5d2017-06-21 12:26:51 +090095 static_libs: [
96 "libarect",
97 ],
98 header_libs: [
Christopher Ferrisddd1d6b2019-09-26 08:27:25 -070099 "bionic_libc_platform_headers",
Jiyong Parka243e5d2017-06-21 12:26:51 +0900100 "gl_headers",
101 "libsystem_headers",
Jiyong Parka243e5d2017-06-21 12:26:51 +0900102 "libnativebase_headers",
103 ],
104 export_header_lib_headers: ["gl_headers"],
Dan Willemsena3310632016-10-03 23:56:51 -0700105}
106
107//##############################################################################
108// Build META EGL library
109//
110cc_defaults {
111 name: "egl_libs_defaults",
112 defaults: ["gl_libs_defaults"],
113 cflags: [
114 "-DLOG_TAG=\"libEGL\"",
Chih-Hung Hsiehc60a0f02017-10-05 14:25:18 -0700115 "-Wall",
116 "-Werror",
117 "-Wno-error=deprecated-register",
118 "-Wno-error=unknown-attributes",
119 "-Wno-unused-variable",
Dan Willemsena3310632016-10-03 23:56:51 -0700120 ],
121 shared_libs: [
Mathias Agopian5f1af042017-03-09 18:50:05 -0800122 // ***** DO NOT ADD NEW DEPENDENCIES HERE *****
123 // In particular, DO NOT add libutils nor anything "above" libui
Jiyong Park27c39e12017-05-08 13:00:02 +0900124 "libgraphicsenv",
Mathias Agopian89ed4c82017-02-09 18:48:34 -0800125 "libnativewindow",
Michael Hoisie4e0f56b2020-04-30 18:40:55 -0400126 "libbase",
Dan Willemsena3310632016-10-03 23:56:51 -0700127 ],
128}
129
130cc_library_static {
131 name: "libEGL_getProcAddress",
132 defaults: ["egl_libs_defaults"],
133 srcs: ["EGL/getProcAddress.cpp"],
134 arch: {
135 arm: {
136 instruction_set: "arm",
137 },
138 },
139}
140
Stan Iliev9e7cd072017-10-09 15:56:10 -0400141cc_library_static {
142 name: "libEGL_blobCache",
143 defaults: ["egl_libs_defaults"],
144 srcs: [
145 "EGL/BlobCache.cpp",
146 "EGL/FileBlobCache.cpp",
Cody Northrop6cca6c22023-02-08 20:23:13 -0700147 "EGL/MultifileBlobCache.cpp",
Stan Iliev9e7cd072017-10-09 15:56:10 -0400148 ],
149 export_include_dirs: ["EGL"],
Jisun Lee88a1b762024-10-17 20:12:29 +0900150 shared_libs: [
Cody Northrop4ee63862024-11-19 22:41:23 -0700151 "libegl_flags",
Jisun Lee88a1b762024-10-17 20:12:29 +0900152 "libz",
153 ],
Stan Iliev9e7cd072017-10-09 15:56:10 -0400154}
155
Dan Willemsena3310632016-10-03 23:56:51 -0700156cc_library_shared {
157 name: "libEGL",
158 defaults: ["egl_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700159 llndk: {
160 symbol_file: "libEGL.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700161 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700162 // Don't export EGL/include from the LLNDK variant.
163 override_export_include_dirs: [],
164 },
Dan Willemsena3310632016-10-03 23:56:51 -0700165 srcs: [
166 "EGL/egl_tls.cpp",
167 "EGL/egl_cache.cpp",
168 "EGL/egl_display.cpp",
169 "EGL/egl_object.cpp",
Cody Northrop629ce4e2018-10-15 07:22:09 -0600170 "EGL/egl_layers.cpp",
Dan Willemsena3310632016-10-03 23:56:51 -0700171 "EGL/egl.cpp",
Cody Northrop68d10352018-10-15 07:22:09 -0600172 "EGL/eglApi.cpp",
Cody Northrop0ec5d382018-10-15 07:22:07 -0600173 "EGL/egl_platform_entries.cpp",
Dan Willemsena3310632016-10-03 23:56:51 -0700174 "EGL/Loader.cpp",
Tobin Ehlis96a184d2018-07-18 16:14:07 -0600175 "EGL/egl_angle_platform.cpp",
Dan Willemsena3310632016-10-03 23:56:51 -0700176 ],
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600177 shared_libs: [
178 "libvndksupport",
179 "android.hardware.configstore@1.0",
180 "android.hardware.configstore-utils",
Cody Northrop629ce4e2018-10-15 07:22:09 -0600181 "libbase",
Cody Northrop4ee63862024-11-19 22:41:23 -0700182 "libegl_flags",
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600183 "libhidlbase",
Jiyong Parkbd1ddb22019-02-18 21:22:28 +0900184 "libnativebridge_lazy",
185 "libnativeloader_lazy",
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600186 "libutils",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900187 "libSurfaceFlingerProp",
Christopher Ferrisdfb50b42022-03-23 12:37:58 -0700188 "libunwindstack",
Jisun Lee88a1b762024-10-17 20:12:29 +0900189 "libz",
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600190 ],
Stan Iliev9e7cd072017-10-09 15:56:10 -0400191 static_libs: [
192 "libEGL_getProcAddress",
193 "libEGL_blobCache",
194 ],
Yu Liu1b5902e2022-09-22 12:14:34 -0700195 ldflags: [
196 "-Wl,--exclude-libs=libEGL_getProcAddress.a",
197 "-Wl,--exclude-libs=libEGL_blobCache.a",
198 "-Wl,--Bsymbolic-functions",
199 ],
Mathias Agopianb7f9a242017-03-08 22:29:31 -0800200 export_include_dirs: ["EGL/include"],
jorgegil@google.come8141512019-11-21 13:42:16 -0800201 stubs: {
202 symbol_file: "libEGL.map.txt",
203 versions: ["29"],
204 },
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900205 header_libs: ["libsurfaceflinger_headers"],
Mathias Agopianb7f9a242017-03-08 22:29:31 -0800206}
207
208cc_test {
209 name: "libEGL_test",
210 defaults: ["egl_libs_defaults"],
211 srcs: [
212 "EGL/BlobCache.cpp",
213 "EGL/BlobCache_test.cpp",
Cody Northrop999db232023-02-27 17:02:50 -0700214 "EGL/FileBlobCache.cpp",
Cody Northrop6cca6c22023-02-08 20:23:13 -0700215 "EGL/MultifileBlobCache.cpp",
216 "EGL/MultifileBlobCache_test.cpp",
217 ],
218 shared_libs: [
Cody Northrop4ee63862024-11-19 22:41:23 -0700219 "libegl_flags",
Cody Northrop6cca6c22023-02-08 20:23:13 -0700220 "libutils",
Jisun Lee88a1b762024-10-17 20:12:29 +0900221 "libz",
Mathias Agopianb7f9a242017-03-08 22:29:31 -0800222 ],
Dan Willemsena3310632016-10-03 23:56:51 -0700223}
224
225cc_defaults {
226 name: "gles_libs_defaults",
227 defaults: ["gl_libs_defaults"],
228 arch: {
229 arm: {
230 instruction_set: "arm",
231
232 // TODO: This is to work around b/20093774. Remove after root cause is fixed
233 ldflags: ["-Wl,--hash-style,both"],
234 },
235 },
236 shared_libs: ["libEGL"],
237}
238
239//##############################################################################
240// Build the wrapper OpenGL ES 1.x library
241//
242cc_library_shared {
243 name: "libGLESv1_CM",
244 defaults: ["gles_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700245 llndk: {
246 symbol_file: "libGLESv1_CM.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700247 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700248 // Don't export EGL/include from the LLNDK variant.
249 override_export_include_dirs: [],
250 },
Dan Willemsena3310632016-10-03 23:56:51 -0700251 srcs: ["GLES_CM/gl.cpp"],
Dan Willemsena3310632016-10-03 23:56:51 -0700252 cflags: ["-DLOG_TAG=\"libGLESv1\""],
dimitry0b586e82018-12-11 14:33:30 +0100253 version_script: "libGLESv1_CM.map.txt",
Dan Willemsena3310632016-10-03 23:56:51 -0700254}
255
256//##############################################################################
257// Build the wrapper OpenGL ES 2.x library
258//
259cc_library_shared {
260 name: "libGLESv2",
261 defaults: ["gles_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700262 llndk: {
263 symbol_file: "libGLESv2.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700264 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700265 // Don't export EGL/include from the LLNDK variant.
266 override_export_include_dirs: [],
267 },
Dan Willemsena3310632016-10-03 23:56:51 -0700268 srcs: ["GLES2/gl2.cpp"],
Dan Willemsena3310632016-10-03 23:56:51 -0700269 cflags: ["-DLOG_TAG=\"libGLESv2\""],
Pirama Arumuga Nainar5d7eb4f2019-05-29 15:17:53 -0700270
271 // Bug: http://b/133874658 Disable native_coverage as we investigate a
272 // crash in surfaceflinger on coverage-enabled cuttlefish builds.
273 native_coverage: false,
Dan Willemsena3310632016-10-03 23:56:51 -0700274}
275
276//##############################################################################
277// Build the wrapper OpenGL ES 3.x library (this is just different name for v2)
278//
279cc_library_shared {
280 name: "libGLESv3",
281 defaults: ["gles_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700282 llndk: {
283 symbol_file: "libGLESv3.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700284 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700285 // Don't export EGL/include from the LLNDK variant.
286 override_export_include_dirs: [],
287 },
Dan Willemsena3310632016-10-03 23:56:51 -0700288 srcs: ["GLES2/gl2.cpp"],
Dan Willemsena3310632016-10-03 23:56:51 -0700289 cflags: ["-DLOG_TAG=\"libGLESv3\""],
290}