| 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 |  | 
| Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 11 | cc_library { | 
|  | 12 | name: "libETC1", | 
|  | 13 | srcs: ["ETC1/etc1.cpp"], | 
|  | 14 | host_supported: true, | 
| Chih-Hung Hsieh | c60a0f0 | 2017-10-05 14:25:18 -0700 | [diff] [blame] | 15 | cflags: ["-Wall", "-Werror"], | 
| Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 16 |  | 
|  | 17 | target: { | 
|  | 18 | android: { | 
|  | 19 | static: { | 
|  | 20 | enabled: false, | 
|  | 21 | }, | 
|  | 22 | }, | 
|  | 23 | host: { | 
|  | 24 | shared: { | 
|  | 25 | enabled: false, | 
|  | 26 | }, | 
|  | 27 | }, | 
|  | 28 | windows: { | 
|  | 29 | enabled: true, | 
|  | 30 | }, | 
|  | 31 | }, | 
|  | 32 | } | 
| Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 33 |  | 
| Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 34 | // The headers modules are in frameworks/native/opengl/Android.bp. | 
| Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 35 | ndk_library { | 
| Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 36 | name: "libEGL", | 
| Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 37 | symbol_file: "libEGL.map.txt", | 
|  | 38 | first_version: "9", | 
| Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 39 | unversioned_until: "current", | 
| Dan Albert | 49fbff4 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 40 | } | 
| Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 41 |  | 
|  | 42 | ndk_library { | 
| Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 43 | name: "libGLESv1_CM", | 
| Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 44 | symbol_file: "libGLESv1_CM.map.txt", | 
|  | 45 | first_version: "9", | 
| Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 46 | unversioned_until: "current", | 
| Dan Albert | 7facb1d | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 47 | } | 
| Dan Albert | 00500c7 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 48 |  | 
|  | 49 | ndk_library { | 
| Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 50 | name: "libGLESv2", | 
| Dan Albert | 00500c7 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 51 | symbol_file: "libGLESv2.map.txt", | 
|  | 52 | first_version: "9", | 
| Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 53 | unversioned_until: "current", | 
| Dan Albert | 00500c7 | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 54 | } | 
| Dan Albert | d7d8efa | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 55 |  | 
|  | 56 | ndk_library { | 
| Dan Willemsen | 219db6c | 2017-04-07 15:48:39 -0700 | [diff] [blame] | 57 | name: "libGLESv3", | 
| Dan Albert | d7d8efa | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 58 | symbol_file: "libGLESv3.map.txt", | 
|  | 59 | first_version: "18", | 
| Dan Albert | b9c62a6 | 2017-01-05 15:58:50 -0800 | [diff] [blame] | 60 | unversioned_until: "current", | 
| Dan Albert | d7d8efa | 2016-10-03 12:36:00 -0700 | [diff] [blame] | 61 | } | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 62 |  | 
|  | 63 | cc_defaults { | 
|  | 64 | name: "gl_libs_defaults", | 
|  | 65 | cflags: [ | 
|  | 66 | "-DGL_GLEXT_PROTOTYPES", | 
|  | 67 | "-DEGL_EGLEXT_PROTOTYPES", | 
|  | 68 | "-fvisibility=hidden", | 
| Chih-Hung Hsieh | c60a0f0 | 2017-10-05 14:25:18 -0700 | [diff] [blame] | 69 | "-Wall", | 
|  | 70 | "-Werror", | 
|  | 71 | "-Wno-unused-variable", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 72 | ], | 
|  | 73 | shared_libs: [ | 
| Mathias Agopian | 5f1af04 | 2017-03-09 18:50:05 -0800 | [diff] [blame] | 74 | // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** | 
|  | 75 | // In particular, DO NOT add libutils or anything "above" libcutils | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 76 | "libcutils", | 
|  | 77 | "liblog", | 
|  | 78 | "libdl", | 
|  | 79 | ], | 
| Jiyong Park | a243e5d | 2017-06-21 12:26:51 +0900 | [diff] [blame] | 80 | static_libs: [ | 
|  | 81 | "libarect", | 
|  | 82 | ], | 
|  | 83 | header_libs: [ | 
| Christopher Ferris | ddd1d6b | 2019-09-26 08:27:25 -0700 | [diff] [blame] | 84 | "bionic_libc_platform_headers", | 
| Jiyong Park | a243e5d | 2017-06-21 12:26:51 +0900 | [diff] [blame] | 85 | "gl_headers", | 
|  | 86 | "libsystem_headers", | 
| Jiyong Park | a243e5d | 2017-06-21 12:26:51 +0900 | [diff] [blame] | 87 | "libnativebase_headers", | 
|  | 88 | ], | 
|  | 89 | export_header_lib_headers: ["gl_headers"], | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 90 | } | 
|  | 91 |  | 
|  | 92 | //############################################################################## | 
|  | 93 | // Build META EGL library | 
|  | 94 | // | 
|  | 95 | cc_defaults { | 
|  | 96 | name: "egl_libs_defaults", | 
|  | 97 | defaults: ["gl_libs_defaults"], | 
|  | 98 | cflags: [ | 
|  | 99 | "-DLOG_TAG=\"libEGL\"", | 
| Chih-Hung Hsieh | c60a0f0 | 2017-10-05 14:25:18 -0700 | [diff] [blame] | 100 | "-Wall", | 
|  | 101 | "-Werror", | 
|  | 102 | "-Wno-error=deprecated-register", | 
|  | 103 | "-Wno-error=unknown-attributes", | 
|  | 104 | "-Wno-unused-variable", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 105 | ], | 
|  | 106 | shared_libs: [ | 
| Mathias Agopian | 5f1af04 | 2017-03-09 18:50:05 -0800 | [diff] [blame] | 107 | // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** | 
|  | 108 | // In particular, DO NOT add libutils nor anything "above" libui | 
| Jiyong Park | 27c39e1 | 2017-05-08 13:00:02 +0900 | [diff] [blame] | 109 | "libgraphicsenv", | 
| Mathias Agopian | 89ed4c8 | 2017-02-09 18:48:34 -0800 | [diff] [blame] | 110 | "libnativewindow", | 
| Mathias Agopian | 5f1af04 | 2017-03-09 18:50:05 -0800 | [diff] [blame] | 111 | "libbacktrace", | 
| Michael Hoisie | 4e0f56b | 2020-04-30 18:40:55 -0400 | [diff] [blame] | 112 | "libbase", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 113 | ], | 
|  | 114 | } | 
|  | 115 |  | 
|  | 116 | cc_library_static { | 
|  | 117 | name: "libEGL_getProcAddress", | 
|  | 118 | defaults: ["egl_libs_defaults"], | 
|  | 119 | srcs: ["EGL/getProcAddress.cpp"], | 
|  | 120 | arch: { | 
|  | 121 | arm: { | 
|  | 122 | instruction_set: "arm", | 
|  | 123 | }, | 
|  | 124 | }, | 
|  | 125 | } | 
|  | 126 |  | 
| Stan Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 127 | cc_library_static { | 
|  | 128 | name: "libEGL_blobCache", | 
|  | 129 | defaults: ["egl_libs_defaults"], | 
|  | 130 | srcs: [ | 
|  | 131 | "EGL/BlobCache.cpp", | 
|  | 132 | "EGL/FileBlobCache.cpp", | 
|  | 133 | ], | 
|  | 134 | export_include_dirs: ["EGL"], | 
|  | 135 | } | 
|  | 136 |  | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 137 | cc_library_shared { | 
|  | 138 | name: "libEGL", | 
|  | 139 | defaults: ["egl_libs_defaults"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 140 | llndk: { | 
|  | 141 | symbol_file: "libEGL.map.txt", | 
| Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 142 | export_llndk_headers: ["gl_headers"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 143 | // Don't export EGL/include from the LLNDK variant. | 
|  | 144 | override_export_include_dirs: [], | 
|  | 145 | }, | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 146 | srcs: [ | 
|  | 147 | "EGL/egl_tls.cpp", | 
|  | 148 | "EGL/egl_cache.cpp", | 
|  | 149 | "EGL/egl_display.cpp", | 
|  | 150 | "EGL/egl_object.cpp", | 
| Cody Northrop | 629ce4e | 2018-10-15 07:22:09 -0600 | [diff] [blame] | 151 | "EGL/egl_layers.cpp", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 152 | "EGL/egl.cpp", | 
| Cody Northrop | 68d1035 | 2018-10-15 07:22:09 -0600 | [diff] [blame] | 153 | "EGL/eglApi.cpp", | 
| Cody Northrop | 0ec5d38 | 2018-10-15 07:22:07 -0600 | [diff] [blame] | 154 | "EGL/egl_platform_entries.cpp", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 155 | "EGL/Loader.cpp", | 
| Tobin Ehlis | 96a184d | 2018-07-18 16:14:07 -0600 | [diff] [blame] | 156 | "EGL/egl_angle_platform.cpp", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 157 | ], | 
| Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 158 | shared_libs: [ | 
|  | 159 | "libvndksupport", | 
|  | 160 | "android.hardware.configstore@1.0", | 
|  | 161 | "android.hardware.configstore-utils", | 
| Cody Northrop | 629ce4e | 2018-10-15 07:22:09 -0600 | [diff] [blame] | 162 | "libbase", | 
| Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 163 | "libhidlbase", | 
| Jiyong Park | bd1ddb2 | 2019-02-18 21:22:28 +0900 | [diff] [blame] | 164 | "libnativebridge_lazy", | 
|  | 165 | "libnativeloader_lazy", | 
| Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 166 | "libutils", | 
| Sundong Ahn | 204fb1f | 2020-04-23 21:56:36 +0900 | [diff] [blame] | 167 | "libSurfaceFlingerProp", | 
| Courtney Goeltzenleuchter | 1b71702 | 2017-07-07 14:55:40 -0600 | [diff] [blame] | 168 | ], | 
| Stan Iliev | 9e7cd07 | 2017-10-09 15:56:10 -0400 | [diff] [blame] | 169 | static_libs: [ | 
|  | 170 | "libEGL_getProcAddress", | 
|  | 171 | "libEGL_blobCache", | 
|  | 172 | ], | 
| Tao Wu | 8f054a6 | 2019-05-14 09:16:07 -0700 | [diff] [blame] | 173 | ldflags: ["-Wl,--exclude-libs=ALL,--Bsymbolic-functions"], | 
| Mathias Agopian | b7f9a24 | 2017-03-08 22:29:31 -0800 | [diff] [blame] | 174 | export_include_dirs: ["EGL/include"], | 
| jorgegil@google.com | e814151 | 2019-11-21 13:42:16 -0800 | [diff] [blame] | 175 | stubs: { | 
|  | 176 | symbol_file: "libEGL.map.txt", | 
|  | 177 | versions: ["29"], | 
|  | 178 | }, | 
| Sundong Ahn | 204fb1f | 2020-04-23 21:56:36 +0900 | [diff] [blame] | 179 | header_libs: ["libsurfaceflinger_headers"], | 
| Mathias Agopian | b7f9a24 | 2017-03-08 22:29:31 -0800 | [diff] [blame] | 180 | } | 
|  | 181 |  | 
|  | 182 | cc_test { | 
|  | 183 | name: "libEGL_test", | 
|  | 184 | defaults: ["egl_libs_defaults"], | 
|  | 185 | srcs: [ | 
|  | 186 | "EGL/BlobCache.cpp", | 
|  | 187 | "EGL/BlobCache_test.cpp", | 
|  | 188 | ], | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 189 | } | 
|  | 190 |  | 
|  | 191 | cc_defaults { | 
|  | 192 | name: "gles_libs_defaults", | 
|  | 193 | defaults: ["gl_libs_defaults"], | 
|  | 194 | arch: { | 
|  | 195 | arm: { | 
|  | 196 | instruction_set: "arm", | 
|  | 197 |  | 
|  | 198 | // TODO: This is to work around b/20093774. Remove after root cause is fixed | 
|  | 199 | ldflags: ["-Wl,--hash-style,both"], | 
|  | 200 | }, | 
|  | 201 | }, | 
|  | 202 | shared_libs: ["libEGL"], | 
|  | 203 | } | 
|  | 204 |  | 
|  | 205 | //############################################################################## | 
|  | 206 | // Build the wrapper OpenGL ES 1.x library | 
|  | 207 | // | 
|  | 208 | cc_library_shared { | 
|  | 209 | name: "libGLESv1_CM", | 
|  | 210 | defaults: ["gles_libs_defaults"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 211 | llndk: { | 
|  | 212 | symbol_file: "libGLESv1_CM.map.txt", | 
| Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 213 | export_llndk_headers: ["gl_headers"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 214 | // Don't export EGL/include from the LLNDK variant. | 
|  | 215 | override_export_include_dirs: [], | 
|  | 216 | }, | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 217 | srcs: ["GLES_CM/gl.cpp"], | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 218 | cflags: ["-DLOG_TAG=\"libGLESv1\""], | 
| dimitry | 0b586e8 | 2018-12-11 14:33:30 +0100 | [diff] [blame] | 219 | version_script: "libGLESv1_CM.map.txt", | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 220 | } | 
|  | 221 |  | 
|  | 222 | //############################################################################## | 
|  | 223 | // Build the wrapper OpenGL ES 2.x library | 
|  | 224 | // | 
|  | 225 | cc_library_shared { | 
|  | 226 | name: "libGLESv2", | 
|  | 227 | defaults: ["gles_libs_defaults"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 228 | llndk: { | 
|  | 229 | symbol_file: "libGLESv2.map.txt", | 
| Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 230 | export_llndk_headers: ["gl_headers"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 231 | // Don't export EGL/include from the LLNDK variant. | 
|  | 232 | override_export_include_dirs: [], | 
|  | 233 | }, | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 234 | srcs: ["GLES2/gl2.cpp"], | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 235 | cflags: ["-DLOG_TAG=\"libGLESv2\""], | 
| Pirama Arumuga Nainar | 5d7eb4f | 2019-05-29 15:17:53 -0700 | [diff] [blame] | 236 |  | 
|  | 237 | // Bug: http://b/133874658  Disable native_coverage as we investigate a | 
|  | 238 | // crash in surfaceflinger on coverage-enabled cuttlefish builds. | 
|  | 239 | native_coverage: false, | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 240 | } | 
|  | 241 |  | 
|  | 242 | //############################################################################## | 
|  | 243 | // Build the wrapper OpenGL ES 3.x library (this is just different name for v2) | 
|  | 244 | // | 
|  | 245 | cc_library_shared { | 
|  | 246 | name: "libGLESv3", | 
|  | 247 | defaults: ["gles_libs_defaults"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 248 | llndk: { | 
|  | 249 | symbol_file: "libGLESv3.map.txt", | 
| Colin Cross | ed0e6e6 | 2021-04-26 17:19:59 -0700 | [diff] [blame] | 250 | export_llndk_headers: ["gl_headers"], | 
| Colin Cross | 0394364 | 2021-04-21 16:47:25 -0700 | [diff] [blame] | 251 | // Don't export EGL/include from the LLNDK variant. | 
|  | 252 | override_export_include_dirs: [], | 
|  | 253 | }, | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 254 | srcs: ["GLES2/gl2.cpp"], | 
| Dan Willemsen | a331063 | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 255 | cflags: ["-DLOG_TAG=\"libGLESv3\""], | 
|  | 256 | } |