1// Build the ETC1 library 2package { 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 11cc_library { 12 name: "libETC1", 13 srcs: ["ETC1/etc1.cpp"], 14 host_supported: true, 15 cflags: [ 16 "-Wall", 17 "-Werror", 18 ], 19 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} 36 37// The headers modules are in frameworks/native/opengl/Android.bp. 38ndk_library { 39 name: "libEGL", 40 symbol_file: "libEGL.map.txt", 41 first_version: "9", 42 unversioned_until: "current", 43 export_header_libs: [ 44 "libEGL_headers", 45 ], 46} 47 48ndk_library { 49 name: "libGLESv1_CM", 50 symbol_file: "libGLESv1_CM.map.txt", 51 first_version: "9", 52 unversioned_until: "current", 53 export_header_libs: [ 54 "libGLESv1_CM_headers", 55 ], 56} 57 58ndk_library { 59 name: "libGLESv2", 60 symbol_file: "libGLESv2.map.txt", 61 first_version: "9", 62 unversioned_until: "current", 63 export_header_libs: [ 64 "libGLESv2_headers", 65 ], 66} 67 68ndk_library { 69 name: "libGLESv3", 70 symbol_file: "libGLESv3.map.txt", 71 first_version: "18", 72 unversioned_until: "current", 73 export_header_libs: [ 74 "libGLESv3_headers", 75 ], 76} 77 78cc_defaults { 79 name: "gl_libs_defaults", 80 cflags: [ 81 "-DGL_GLEXT_PROTOTYPES", 82 "-DEGL_EGLEXT_PROTOTYPES", 83 "-fvisibility=hidden", 84 "-Wall", 85 "-Werror", 86 "-Wno-unused-variable", 87 ], 88 shared_libs: [ 89 // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** 90 // In particular, DO NOT add libutils or anything "above" libcutils 91 "libcutils", 92 "liblog", 93 "libdl", 94 ], 95 static_libs: [ 96 "libarect", 97 ], 98 header_libs: [ 99 "bionic_libc_platform_headers", 100 "gl_headers", 101 "libsystem_headers", 102 "libnativebase_headers", 103 ], 104 export_header_lib_headers: ["gl_headers"], 105} 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\"", 115 "-Wall", 116 "-Werror", 117 "-Wno-error=deprecated-register", 118 "-Wno-error=unknown-attributes", 119 "-Wno-unused-variable", 120 ], 121 shared_libs: [ 122 // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** 123 // In particular, DO NOT add libutils nor anything "above" libui 124 "libgraphicsenv", 125 "libnativewindow", 126 "libbase", 127 ], 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 141cc_library_static { 142 name: "libEGL_blobCache", 143 defaults: ["egl_libs_defaults"], 144 srcs: [ 145 "EGL/BlobCache.cpp", 146 "EGL/FileBlobCache.cpp", 147 "EGL/MultifileBlobCache.cpp", 148 ], 149 export_include_dirs: ["EGL"], 150} 151 152cc_library_shared { 153 name: "libEGL", 154 defaults: ["egl_libs_defaults"], 155 llndk: { 156 symbol_file: "libEGL.map.txt", 157 export_llndk_headers: ["gl_headers"], 158 // Don't export EGL/include from the LLNDK variant. 159 override_export_include_dirs: [], 160 }, 161 srcs: [ 162 "EGL/egl_tls.cpp", 163 "EGL/egl_cache.cpp", 164 "EGL/egl_display.cpp", 165 "EGL/egl_object.cpp", 166 "EGL/egl_layers.cpp", 167 "EGL/egl.cpp", 168 "EGL/eglApi.cpp", 169 "EGL/egl_platform_entries.cpp", 170 "EGL/Loader.cpp", 171 "EGL/egl_angle_platform.cpp", 172 ], 173 shared_libs: [ 174 "libvndksupport", 175 "android.hardware.configstore@1.0", 176 "android.hardware.configstore-utils", 177 "libbase", 178 "libhidlbase", 179 "libnativebridge_lazy", 180 "libnativeloader_lazy", 181 "libutils", 182 "libSurfaceFlingerProp", 183 "libunwindstack", 184 ], 185 static_libs: [ 186 "libEGL_getProcAddress", 187 "libEGL_blobCache", 188 ], 189 ldflags: [ 190 "-Wl,--exclude-libs=libEGL_getProcAddress.a", 191 "-Wl,--exclude-libs=libEGL_blobCache.a", 192 "-Wl,--Bsymbolic-functions", 193 ], 194 export_include_dirs: ["EGL/include"], 195 stubs: { 196 symbol_file: "libEGL.map.txt", 197 versions: ["29"], 198 }, 199 header_libs: ["libsurfaceflinger_headers"], 200} 201 202cc_test { 203 name: "libEGL_test", 204 defaults: ["egl_libs_defaults"], 205 srcs: [ 206 "EGL/BlobCache.cpp", 207 "EGL/BlobCache_test.cpp", 208 "EGL/FileBlobCache.cpp", 209 "EGL/MultifileBlobCache.cpp", 210 "EGL/MultifileBlobCache_test.cpp", 211 ], 212 shared_libs: [ 213 "libutils", 214 ], 215} 216 217cc_defaults { 218 name: "gles_libs_defaults", 219 defaults: ["gl_libs_defaults"], 220 arch: { 221 arm: { 222 instruction_set: "arm", 223 224 // TODO: This is to work around b/20093774. Remove after root cause is fixed 225 ldflags: ["-Wl,--hash-style,both"], 226 }, 227 }, 228 shared_libs: ["libEGL"], 229} 230 231//############################################################################## 232// Build the wrapper OpenGL ES 1.x library 233// 234cc_library_shared { 235 name: "libGLESv1_CM", 236 defaults: ["gles_libs_defaults"], 237 llndk: { 238 symbol_file: "libGLESv1_CM.map.txt", 239 export_llndk_headers: ["gl_headers"], 240 // Don't export EGL/include from the LLNDK variant. 241 override_export_include_dirs: [], 242 }, 243 srcs: ["GLES_CM/gl.cpp"], 244 cflags: ["-DLOG_TAG=\"libGLESv1\""], 245 version_script: "libGLESv1_CM.map.txt", 246} 247 248//############################################################################## 249// Build the wrapper OpenGL ES 2.x library 250// 251cc_library_shared { 252 name: "libGLESv2", 253 defaults: ["gles_libs_defaults"], 254 llndk: { 255 symbol_file: "libGLESv2.map.txt", 256 export_llndk_headers: ["gl_headers"], 257 // Don't export EGL/include from the LLNDK variant. 258 override_export_include_dirs: [], 259 }, 260 srcs: ["GLES2/gl2.cpp"], 261 cflags: ["-DLOG_TAG=\"libGLESv2\""], 262 263 // Bug: http://b/133874658 Disable native_coverage as we investigate a 264 // crash in surfaceflinger on coverage-enabled cuttlefish builds. 265 native_coverage: false, 266} 267 268//############################################################################## 269// Build the wrapper OpenGL ES 3.x library (this is just different name for v2) 270// 271cc_library_shared { 272 name: "libGLESv3", 273 defaults: ["gles_libs_defaults"], 274 llndk: { 275 symbol_file: "libGLESv3.map.txt", 276 export_llndk_headers: ["gl_headers"], 277 // Don't export EGL/include from the LLNDK variant. 278 override_export_include_dirs: [], 279 }, 280 srcs: ["GLES2/gl2.cpp"], 281 cflags: ["-DLOG_TAG=\"libGLESv3\""], 282} 283