Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 1 | // Build the ETC1 library |
Bob Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame] | 2 | package { |
| 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 Patten | 15e275c | 2025-01-13 14:23:15 -0700 | [diff] [blame] | 11 | cc_aconfig_library { |
| 12 | name: "libegl_flags_c_lib", |
| 13 | aconfig_declarations: "graphicsenv_flags", |
| 14 | } |
| 15 | |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 16 | cc_library { |
| 17 | name: "libETC1", |
| 18 | srcs: ["ETC1/etc1.cpp"], |
| 19 | host_supported: true, |
Spandan Das | 4a5e3f2 | 2022-09-08 21:49:51 +0000 | [diff] [blame] | 20 | cflags: [ |
| 21 | "-Wall", |
| 22 | "-Werror", |
| 23 | ], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 24 | |
| 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 Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 41 | |
Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 42 | // The headers modules are in frameworks/native/opengl/Android.bp. |
Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 43 | ndk_library { |
Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 44 | name: "libEGL", |
Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 45 | symbol_file: "libEGL.map.txt", |
| 46 | first_version: "9", |
Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 47 | unversioned_until: "current", |
Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 48 | } |
Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 49 | |
| 50 | ndk_library { |
Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 51 | name: "libGLESv1_CM", |
Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 52 | symbol_file: "libGLESv1_CM.map.txt", |
| 53 | first_version: "9", |
Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 54 | unversioned_until: "current", |
Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 55 | } |
Dan Albert | 00500c7 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 56 | |
| 57 | ndk_library { |
Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 58 | name: "libGLESv2", |
Dan Albert | 00500c7 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 59 | symbol_file: "libGLESv2.map.txt", |
| 60 | first_version: "9", |
Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 61 | unversioned_until: "current", |
Dan Albert | 00500c7 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 62 | } |
Dan Albert | d7d8efa | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 63 | |
| 64 | ndk_library { |
Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 65 | name: "libGLESv3", |
Dan Albert | d7d8efa | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 66 | symbol_file: "libGLESv3.map.txt", |
| 67 | first_version: "18", |
Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 68 | unversioned_until: "current", |
Dan Albert | d7d8efa | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 69 | } |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 70 | |
Cody Northrop | 4ee6386 | 2024-11-19 22:41:23 -0700 | [diff] [blame] | 71 | aconfig_declarations { |
| 72 | name: "egl_flags", |
| 73 | package: "com.android.graphics.egl.flags", |
| 74 | container: "system", |
| 75 | srcs: ["EGL/egl_flags.aconfig"], |
| 76 | } |
| 77 | |
| 78 | cc_aconfig_library { |
| 79 | name: "libegl_flags", |
| 80 | aconfig_declarations: "egl_flags", |
| 81 | } |
| 82 | |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 83 | cc_defaults { |
| 84 | name: "gl_libs_defaults", |
| 85 | cflags: [ |
| 86 | "-DGL_GLEXT_PROTOTYPES", |
| 87 | "-DEGL_EGLEXT_PROTOTYPES", |
| 88 | "-fvisibility=hidden", |
Chih-Hung Hsieh | c60a0f0 | 2017-10-05 14:25:18 -0700 | [diff] [blame] | 89 | "-Wall", |
| 90 | "-Werror", |
| 91 | "-Wno-unused-variable", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 92 | ], |
| 93 | shared_libs: [ |
Mathias Agopian | 5f1af04 | 2017-03-09 18:50:05 -0800 | [diff] [blame] | 94 | // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** |
| 95 | // In particular, DO NOT add libutils or anything "above" libcutils |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 96 | "libcutils", |
| 97 | "liblog", |
| 98 | "libdl", |
| 99 | ], |
Jiyong Park | a243e5d | 2017-06-21 12:26:51 +0900 | [diff] [blame] | 100 | static_libs: [ |
| 101 | "libarect", |
| 102 | ], |
| 103 | header_libs: [ |
Christopher Ferris | ddd1d6b | 2019-09-26 08:27:25 -0700 | [diff] [blame] | 104 | "bionic_libc_platform_headers", |
Jiyong Park | a243e5d | 2017-06-21 12:26:51 +0900 | [diff] [blame] | 105 | "gl_headers", |
| 106 | "libsystem_headers", |
Jiyong Park | a243e5d | 2017-06-21 12:26:51 +0900 | [diff] [blame] | 107 | "libnativebase_headers", |
| 108 | ], |
| 109 | export_header_lib_headers: ["gl_headers"], |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | //############################################################################## |
| 113 | // Build META EGL library |
| 114 | // |
| 115 | cc_defaults { |
| 116 | name: "egl_libs_defaults", |
| 117 | defaults: ["gl_libs_defaults"], |
| 118 | cflags: [ |
| 119 | "-DLOG_TAG=\"libEGL\"", |
Chih-Hung Hsieh | c60a0f0 | 2017-10-05 14:25:18 -0700 | [diff] [blame] | 120 | "-Wall", |
| 121 | "-Werror", |
| 122 | "-Wno-error=deprecated-register", |
| 123 | "-Wno-error=unknown-attributes", |
| 124 | "-Wno-unused-variable", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 125 | ], |
| 126 | shared_libs: [ |
Mathias Agopian | 5f1af04 | 2017-03-09 18:50:05 -0800 | [diff] [blame] | 127 | // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** |
| 128 | // In particular, DO NOT add libutils nor anything "above" libui |
Jiyong Park | 27c39e1 | 2017-05-08 13:00:02 +0900 | [diff] [blame] | 129 | "libgraphicsenv", |
Mathias Agopian | 89ed4c8 | 2017-02-09 18:48:34 -0800 | [diff] [blame] | 130 | "libnativewindow", |
Michael Hoisie | 4e0f56b | 2020-04-30 18:40:55 -0400 | [diff] [blame] | 131 | "libbase", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 132 | ], |
| 133 | } |
| 134 | |
| 135 | cc_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 Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 146 | cc_library_static { |
| 147 | name: "libEGL_blobCache", |
| 148 | defaults: ["egl_libs_defaults"], |
| 149 | srcs: [ |
| 150 | "EGL/BlobCache.cpp", |
| 151 | "EGL/FileBlobCache.cpp", |
Cody Northrop | 6cca6c2 | 2023-02-08 20:23:13 -0700 | [diff] [blame] | 152 | "EGL/MultifileBlobCache.cpp", |
Stan Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 153 | ], |
| 154 | export_include_dirs: ["EGL"], |
Jisun Lee | 88a1b76 | 2024-10-17 20:12:29 +0900 | [diff] [blame] | 155 | shared_libs: [ |
Cody Northrop | 4ee6386 | 2024-11-19 22:41:23 -0700 | [diff] [blame] | 156 | "libegl_flags", |
Jisun Lee | 88a1b76 | 2024-10-17 20:12:29 +0900 | [diff] [blame] | 157 | "libz", |
| 158 | ], |
Stan Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 159 | } |
| 160 | |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 161 | cc_library_shared { |
| 162 | name: "libEGL", |
Tim Van Patten | 15e275c | 2025-01-13 14:23:15 -0700 | [diff] [blame] | 163 | defaults: [ |
| 164 | "aconfig_lib_cc_static_link.defaults", |
| 165 | "egl_libs_defaults", |
| 166 | ], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 167 | llndk: { |
| 168 | symbol_file: "libEGL.map.txt", |
Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 169 | export_llndk_headers: ["gl_headers"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 170 | // Don't export EGL/include from the LLNDK variant. |
| 171 | override_export_include_dirs: [], |
| 172 | }, |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 173 | srcs: [ |
| 174 | "EGL/egl_tls.cpp", |
| 175 | "EGL/egl_cache.cpp", |
| 176 | "EGL/egl_display.cpp", |
| 177 | "EGL/egl_object.cpp", |
Cody Northrop | 629ce4e | 2018-10-15 07:22:09 -0600 | [diff] [blame] | 178 | "EGL/egl_layers.cpp", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 179 | "EGL/egl.cpp", |
Cody Northrop | 68d1035 | 2018-10-15 07:22:09 -0600 | [diff] [blame] | 180 | "EGL/eglApi.cpp", |
Cody Northrop | 0ec5d38 | 2018-10-15 07:22:07 -0600 | [diff] [blame] | 181 | "EGL/egl_platform_entries.cpp", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 182 | "EGL/Loader.cpp", |
Tobin Ehlis | 96a184d | 2018-07-18 16:14:07 -0600 | [diff] [blame] | 183 | "EGL/egl_angle_platform.cpp", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 184 | ], |
Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 185 | shared_libs: [ |
| 186 | "libvndksupport", |
| 187 | "android.hardware.configstore@1.0", |
| 188 | "android.hardware.configstore-utils", |
Cody Northrop | 629ce4e | 2018-10-15 07:22:09 -0600 | [diff] [blame] | 189 | "libbase", |
Cody Northrop | 4ee6386 | 2024-11-19 22:41:23 -0700 | [diff] [blame] | 190 | "libegl_flags", |
Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 191 | "libhidlbase", |
Jiyong Park | bd1ddb2 | 2019-02-18 21:22:28 +0900 | [diff] [blame] | 192 | "libnativebridge_lazy", |
| 193 | "libnativeloader_lazy", |
Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 194 | "libutils", |
Sundong Ahn | 204fb1f | 2020-04-23 21:56:36 +0900 | [diff] [blame] | 195 | "libSurfaceFlingerProp", |
Christopher Ferris | dfb50b4 | 2022-03-23 12:37:58 -0700 | [diff] [blame] | 196 | "libunwindstack", |
Jisun Lee | 88a1b76 | 2024-10-17 20:12:29 +0900 | [diff] [blame] | 197 | "libz", |
Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 198 | ], |
Stan Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 199 | static_libs: [ |
| 200 | "libEGL_getProcAddress", |
| 201 | "libEGL_blobCache", |
Tim Van Patten | 15e275c | 2025-01-13 14:23:15 -0700 | [diff] [blame] | 202 | "libegl_flags_c_lib", |
Stan Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 203 | ], |
Yu Liu | 1b5902e | 2022-09-22 12:14:34 -0700 | [diff] [blame] | 204 | ldflags: [ |
| 205 | "-Wl,--exclude-libs=libEGL_getProcAddress.a", |
| 206 | "-Wl,--exclude-libs=libEGL_blobCache.a", |
| 207 | "-Wl,--Bsymbolic-functions", |
| 208 | ], |
Mathias Agopian | b7f9a24 | 2017-03-08 22:29:31 -0800 | [diff] [blame] | 209 | export_include_dirs: ["EGL/include"], |
jorgegil@google.com | e814151 | 2019-11-21 13:42:16 -0800 | [diff] [blame] | 210 | stubs: { |
| 211 | symbol_file: "libEGL.map.txt", |
| 212 | versions: ["29"], |
| 213 | }, |
Sundong Ahn | 204fb1f | 2020-04-23 21:56:36 +0900 | [diff] [blame] | 214 | header_libs: ["libsurfaceflinger_headers"], |
Mathias Agopian | b7f9a24 | 2017-03-08 22:29:31 -0800 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | cc_test { |
| 218 | name: "libEGL_test", |
| 219 | defaults: ["egl_libs_defaults"], |
| 220 | srcs: [ |
| 221 | "EGL/BlobCache.cpp", |
| 222 | "EGL/BlobCache_test.cpp", |
Cody Northrop | 999db23 | 2023-02-27 17:02:50 -0700 | [diff] [blame] | 223 | "EGL/FileBlobCache.cpp", |
Cody Northrop | 6cca6c2 | 2023-02-08 20:23:13 -0700 | [diff] [blame] | 224 | "EGL/MultifileBlobCache.cpp", |
| 225 | "EGL/MultifileBlobCache_test.cpp", |
| 226 | ], |
| 227 | shared_libs: [ |
Cody Northrop | 4ee6386 | 2024-11-19 22:41:23 -0700 | [diff] [blame] | 228 | "libegl_flags", |
Cody Northrop | 6cca6c2 | 2023-02-08 20:23:13 -0700 | [diff] [blame] | 229 | "libutils", |
Jisun Lee | 88a1b76 | 2024-10-17 20:12:29 +0900 | [diff] [blame] | 230 | "libz", |
Mathias Agopian | b7f9a24 | 2017-03-08 22:29:31 -0800 | [diff] [blame] | 231 | ], |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | cc_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 | // |
| 251 | cc_library_shared { |
| 252 | name: "libGLESv1_CM", |
| 253 | defaults: ["gles_libs_defaults"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 254 | llndk: { |
| 255 | symbol_file: "libGLESv1_CM.map.txt", |
Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 256 | export_llndk_headers: ["gl_headers"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 257 | // Don't export EGL/include from the LLNDK variant. |
| 258 | override_export_include_dirs: [], |
| 259 | }, |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 260 | srcs: ["GLES_CM/gl.cpp"], |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 261 | cflags: ["-DLOG_TAG=\"libGLESv1\""], |
dimitry | 0b586e8 | 2018-12-11 14:33:30 +0100 | [diff] [blame] | 262 | version_script: "libGLESv1_CM.map.txt", |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | //############################################################################## |
| 266 | // Build the wrapper OpenGL ES 2.x library |
| 267 | // |
| 268 | cc_library_shared { |
| 269 | name: "libGLESv2", |
| 270 | defaults: ["gles_libs_defaults"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 271 | llndk: { |
| 272 | symbol_file: "libGLESv2.map.txt", |
Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 273 | export_llndk_headers: ["gl_headers"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 274 | // Don't export EGL/include from the LLNDK variant. |
| 275 | override_export_include_dirs: [], |
| 276 | }, |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 277 | srcs: ["GLES2/gl2.cpp"], |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 278 | cflags: ["-DLOG_TAG=\"libGLESv2\""], |
Pirama Arumuga Nainar | 5d7eb4f | 2019-05-29 15:17:53 -0700 | [diff] [blame] | 279 | |
| 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 Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | //############################################################################## |
| 286 | // Build the wrapper OpenGL ES 3.x library (this is just different name for v2) |
| 287 | // |
| 288 | cc_library_shared { |
| 289 | name: "libGLESv3", |
| 290 | defaults: ["gles_libs_defaults"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 291 | llndk: { |
| 292 | symbol_file: "libGLESv3.map.txt", |
Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 293 | export_llndk_headers: ["gl_headers"], |
Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 294 | // Don't export EGL/include from the LLNDK variant. |
| 295 | override_export_include_dirs: [], |
| 296 | }, |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 297 | srcs: ["GLES2/gl2.cpp"], |
Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 298 | cflags: ["-DLOG_TAG=\"libGLESv3\""], |
| 299 | } |