blob: eb747c767eaf814b579ca9a92a733d93b522e3d1 [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
Tim Van Patten15e275c2025-01-13 14:23:15 -070011cc_aconfig_library {
12 name: "libegl_flags_c_lib",
13 aconfig_declarations: "graphicsenv_flags",
14}
15
Dan Willemsen59e086f2016-07-25 17:13:45 -070016cc_library {
17 name: "libETC1",
18 srcs: ["ETC1/etc1.cpp"],
19 host_supported: true,
Spandan Das4a5e3f22022-09-08 21:49:51 +000020 cflags: [
21 "-Wall",
22 "-Werror",
23 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070024
25 target: {
26 android: {
27 static: {
28 enabled: false,
29 },
30 },
31 host: {
32 shared: {
33 enabled: false,
34 },
35 },
36 windows: {
37 enabled: true,
38 },
39 },
40}
Dan Albert49fbff42016-10-03 12:36:00 -070041
Dan Albert7facb1d2016-10-03 12:36:00 -070042// The headers modules are in frameworks/native/opengl/Android.bp.
Dan Albert49fbff42016-10-03 12:36:00 -070043ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070044 name: "libEGL",
Dan Albert49fbff42016-10-03 12:36:00 -070045 symbol_file: "libEGL.map.txt",
46 first_version: "9",
Dan Albertb9c62a62017-01-05 15:58:50 -080047 unversioned_until: "current",
Dan Albert49fbff42016-10-03 12:36:00 -070048}
Dan Albert7facb1d2016-10-03 12:36:00 -070049
50ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070051 name: "libGLESv1_CM",
Dan Albert7facb1d2016-10-03 12:36:00 -070052 symbol_file: "libGLESv1_CM.map.txt",
53 first_version: "9",
Dan Albertb9c62a62017-01-05 15:58:50 -080054 unversioned_until: "current",
Dan Albert7facb1d2016-10-03 12:36:00 -070055}
Dan Albert00500c72016-10-03 12:36:00 -070056
57ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070058 name: "libGLESv2",
Dan Albert00500c72016-10-03 12:36:00 -070059 symbol_file: "libGLESv2.map.txt",
60 first_version: "9",
Dan Albertb9c62a62017-01-05 15:58:50 -080061 unversioned_until: "current",
Dan Albert00500c72016-10-03 12:36:00 -070062}
Dan Albertd7d8efa2016-10-03 12:36:00 -070063
64ndk_library {
Dan Willemsen219db6c2017-04-07 15:48:39 -070065 name: "libGLESv3",
Dan Albertd7d8efa2016-10-03 12:36:00 -070066 symbol_file: "libGLESv3.map.txt",
67 first_version: "18",
Dan Albertb9c62a62017-01-05 15:58:50 -080068 unversioned_until: "current",
Dan Albertd7d8efa2016-10-03 12:36:00 -070069}
Dan Willemsena3310632016-10-03 23:56:51 -070070
Cody Northrop4ee63862024-11-19 22:41:23 -070071aconfig_declarations {
72 name: "egl_flags",
73 package: "com.android.graphics.egl.flags",
74 container: "system",
75 srcs: ["EGL/egl_flags.aconfig"],
76}
77
78cc_aconfig_library {
79 name: "libegl_flags",
80 aconfig_declarations: "egl_flags",
81}
82
Dan Willemsena3310632016-10-03 23:56:51 -070083cc_defaults {
84 name: "gl_libs_defaults",
85 cflags: [
86 "-DGL_GLEXT_PROTOTYPES",
87 "-DEGL_EGLEXT_PROTOTYPES",
88 "-fvisibility=hidden",
Chih-Hung Hsiehc60a0f02017-10-05 14:25:18 -070089 "-Wall",
90 "-Werror",
91 "-Wno-unused-variable",
Dan Willemsena3310632016-10-03 23:56:51 -070092 ],
93 shared_libs: [
Mathias Agopian5f1af042017-03-09 18:50:05 -080094 // ***** DO NOT ADD NEW DEPENDENCIES HERE *****
95 // In particular, DO NOT add libutils or anything "above" libcutils
Dan Willemsena3310632016-10-03 23:56:51 -070096 "libcutils",
97 "liblog",
98 "libdl",
99 ],
Jiyong Parka243e5d2017-06-21 12:26:51 +0900100 static_libs: [
101 "libarect",
102 ],
103 header_libs: [
Christopher Ferrisddd1d6b2019-09-26 08:27:25 -0700104 "bionic_libc_platform_headers",
Jiyong Parka243e5d2017-06-21 12:26:51 +0900105 "gl_headers",
106 "libsystem_headers",
Jiyong Parka243e5d2017-06-21 12:26:51 +0900107 "libnativebase_headers",
108 ],
109 export_header_lib_headers: ["gl_headers"],
Dan Willemsena3310632016-10-03 23:56:51 -0700110}
111
112//##############################################################################
113// Build META EGL library
114//
115cc_defaults {
116 name: "egl_libs_defaults",
117 defaults: ["gl_libs_defaults"],
118 cflags: [
119 "-DLOG_TAG=\"libEGL\"",
Chih-Hung Hsiehc60a0f02017-10-05 14:25:18 -0700120 "-Wall",
121 "-Werror",
122 "-Wno-error=deprecated-register",
123 "-Wno-error=unknown-attributes",
124 "-Wno-unused-variable",
Dan Willemsena3310632016-10-03 23:56:51 -0700125 ],
126 shared_libs: [
Mathias Agopian5f1af042017-03-09 18:50:05 -0800127 // ***** DO NOT ADD NEW DEPENDENCIES HERE *****
128 // In particular, DO NOT add libutils nor anything "above" libui
Jiyong Park27c39e12017-05-08 13:00:02 +0900129 "libgraphicsenv",
Mathias Agopian89ed4c82017-02-09 18:48:34 -0800130 "libnativewindow",
Michael Hoisie4e0f56b2020-04-30 18:40:55 -0400131 "libbase",
Dan Willemsena3310632016-10-03 23:56:51 -0700132 ],
133}
134
135cc_library_static {
136 name: "libEGL_getProcAddress",
137 defaults: ["egl_libs_defaults"],
138 srcs: ["EGL/getProcAddress.cpp"],
139 arch: {
140 arm: {
141 instruction_set: "arm",
142 },
143 },
144}
145
Stan Iliev9e7cd072017-10-09 15:56:10 -0400146cc_library_static {
147 name: "libEGL_blobCache",
148 defaults: ["egl_libs_defaults"],
149 srcs: [
150 "EGL/BlobCache.cpp",
151 "EGL/FileBlobCache.cpp",
Cody Northrop6cca6c22023-02-08 20:23:13 -0700152 "EGL/MultifileBlobCache.cpp",
Stan Iliev9e7cd072017-10-09 15:56:10 -0400153 ],
154 export_include_dirs: ["EGL"],
Jisun Lee88a1b762024-10-17 20:12:29 +0900155 shared_libs: [
Cody Northrop4ee63862024-11-19 22:41:23 -0700156 "libegl_flags",
Jisun Lee88a1b762024-10-17 20:12:29 +0900157 "libz",
158 ],
Stan Iliev9e7cd072017-10-09 15:56:10 -0400159}
160
Dan Willemsena3310632016-10-03 23:56:51 -0700161cc_library_shared {
162 name: "libEGL",
Tim Van Patten15e275c2025-01-13 14:23:15 -0700163 defaults: [
164 "aconfig_lib_cc_static_link.defaults",
165 "egl_libs_defaults",
166 ],
Colin Cross03943642021-04-21 16:47:25 -0700167 llndk: {
168 symbol_file: "libEGL.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700169 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700170 // Don't export EGL/include from the LLNDK variant.
171 override_export_include_dirs: [],
172 },
Dan Willemsena3310632016-10-03 23:56:51 -0700173 srcs: [
174 "EGL/egl_tls.cpp",
175 "EGL/egl_cache.cpp",
176 "EGL/egl_display.cpp",
177 "EGL/egl_object.cpp",
Cody Northrop629ce4e2018-10-15 07:22:09 -0600178 "EGL/egl_layers.cpp",
Dan Willemsena3310632016-10-03 23:56:51 -0700179 "EGL/egl.cpp",
Cody Northrop68d10352018-10-15 07:22:09 -0600180 "EGL/eglApi.cpp",
Cody Northrop0ec5d382018-10-15 07:22:07 -0600181 "EGL/egl_platform_entries.cpp",
Dan Willemsena3310632016-10-03 23:56:51 -0700182 "EGL/Loader.cpp",
Tobin Ehlis96a184d2018-07-18 16:14:07 -0600183 "EGL/egl_angle_platform.cpp",
Dan Willemsena3310632016-10-03 23:56:51 -0700184 ],
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600185 shared_libs: [
186 "libvndksupport",
187 "android.hardware.configstore@1.0",
188 "android.hardware.configstore-utils",
Cody Northrop629ce4e2018-10-15 07:22:09 -0600189 "libbase",
Cody Northrop4ee63862024-11-19 22:41:23 -0700190 "libegl_flags",
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600191 "libhidlbase",
Jiyong Parkbd1ddb22019-02-18 21:22:28 +0900192 "libnativebridge_lazy",
193 "libnativeloader_lazy",
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600194 "libutils",
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900195 "libSurfaceFlingerProp",
Christopher Ferrisdfb50b42022-03-23 12:37:58 -0700196 "libunwindstack",
Jisun Lee88a1b762024-10-17 20:12:29 +0900197 "libz",
Courtney Goeltzenleuchter1b717022017-07-07 14:55:40 -0600198 ],
Stan Iliev9e7cd072017-10-09 15:56:10 -0400199 static_libs: [
200 "libEGL_getProcAddress",
201 "libEGL_blobCache",
Tim Van Patten15e275c2025-01-13 14:23:15 -0700202 "libegl_flags_c_lib",
Stan Iliev9e7cd072017-10-09 15:56:10 -0400203 ],
Yu Liu1b5902e2022-09-22 12:14:34 -0700204 ldflags: [
205 "-Wl,--exclude-libs=libEGL_getProcAddress.a",
206 "-Wl,--exclude-libs=libEGL_blobCache.a",
207 "-Wl,--Bsymbolic-functions",
208 ],
Mathias Agopianb7f9a242017-03-08 22:29:31 -0800209 export_include_dirs: ["EGL/include"],
jorgegil@google.come8141512019-11-21 13:42:16 -0800210 stubs: {
211 symbol_file: "libEGL.map.txt",
212 versions: ["29"],
213 },
Sundong Ahn204fb1f2020-04-23 21:56:36 +0900214 header_libs: ["libsurfaceflinger_headers"],
Mathias Agopianb7f9a242017-03-08 22:29:31 -0800215}
216
217cc_test {
218 name: "libEGL_test",
219 defaults: ["egl_libs_defaults"],
220 srcs: [
221 "EGL/BlobCache.cpp",
222 "EGL/BlobCache_test.cpp",
Cody Northrop999db232023-02-27 17:02:50 -0700223 "EGL/FileBlobCache.cpp",
Cody Northrop6cca6c22023-02-08 20:23:13 -0700224 "EGL/MultifileBlobCache.cpp",
225 "EGL/MultifileBlobCache_test.cpp",
226 ],
227 shared_libs: [
Cody Northrop4ee63862024-11-19 22:41:23 -0700228 "libegl_flags",
Cody Northrop6cca6c22023-02-08 20:23:13 -0700229 "libutils",
Jisun Lee88a1b762024-10-17 20:12:29 +0900230 "libz",
Mathias Agopianb7f9a242017-03-08 22:29:31 -0800231 ],
Dan Willemsena3310632016-10-03 23:56:51 -0700232}
233
234cc_defaults {
235 name: "gles_libs_defaults",
236 defaults: ["gl_libs_defaults"],
237 arch: {
238 arm: {
239 instruction_set: "arm",
240
241 // TODO: This is to work around b/20093774. Remove after root cause is fixed
242 ldflags: ["-Wl,--hash-style,both"],
243 },
244 },
245 shared_libs: ["libEGL"],
246}
247
248//##############################################################################
249// Build the wrapper OpenGL ES 1.x library
250//
251cc_library_shared {
252 name: "libGLESv1_CM",
253 defaults: ["gles_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700254 llndk: {
255 symbol_file: "libGLESv1_CM.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700256 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700257 // Don't export EGL/include from the LLNDK variant.
258 override_export_include_dirs: [],
259 },
Dan Willemsena3310632016-10-03 23:56:51 -0700260 srcs: ["GLES_CM/gl.cpp"],
Dan Willemsena3310632016-10-03 23:56:51 -0700261 cflags: ["-DLOG_TAG=\"libGLESv1\""],
dimitry0b586e82018-12-11 14:33:30 +0100262 version_script: "libGLESv1_CM.map.txt",
Dan Willemsena3310632016-10-03 23:56:51 -0700263}
264
265//##############################################################################
266// Build the wrapper OpenGL ES 2.x library
267//
268cc_library_shared {
269 name: "libGLESv2",
270 defaults: ["gles_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700271 llndk: {
272 symbol_file: "libGLESv2.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700273 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700274 // Don't export EGL/include from the LLNDK variant.
275 override_export_include_dirs: [],
276 },
Dan Willemsena3310632016-10-03 23:56:51 -0700277 srcs: ["GLES2/gl2.cpp"],
Dan Willemsena3310632016-10-03 23:56:51 -0700278 cflags: ["-DLOG_TAG=\"libGLESv2\""],
Pirama Arumuga Nainar5d7eb4f2019-05-29 15:17:53 -0700279
280 // Bug: http://b/133874658 Disable native_coverage as we investigate a
281 // crash in surfaceflinger on coverage-enabled cuttlefish builds.
282 native_coverage: false,
Dan Willemsena3310632016-10-03 23:56:51 -0700283}
284
285//##############################################################################
286// Build the wrapper OpenGL ES 3.x library (this is just different name for v2)
287//
288cc_library_shared {
289 name: "libGLESv3",
290 defaults: ["gles_libs_defaults"],
Colin Cross03943642021-04-21 16:47:25 -0700291 llndk: {
292 symbol_file: "libGLESv3.map.txt",
Colin Crossed0e6e62021-04-26 17:19:59 -0700293 export_llndk_headers: ["gl_headers"],
Colin Cross03943642021-04-21 16:47:25 -0700294 // Don't export EGL/include from the LLNDK variant.
295 override_export_include_dirs: [],
296 },
Dan Willemsena3310632016-10-03 23:56:51 -0700297 srcs: ["GLES2/gl2.cpp"],
Dan Willemsena3310632016-10-03 23:56:51 -0700298 cflags: ["-DLOG_TAG=\"libGLESv3\""],
299}