1// Build the ETC1 library 2cc_library { 3 name: "libETC1", 4 srcs: ["ETC1/etc1.cpp"], 5 host_supported: true, 6 7 target: { 8 android: { 9 static: { 10 enabled: false, 11 }, 12 }, 13 host: { 14 shared: { 15 enabled: false, 16 }, 17 }, 18 windows: { 19 enabled: true, 20 }, 21 }, 22} 23 24// The headers modules are in frameworks/native/opengl/Android.bp. 25ndk_library { 26 name: "libEGL", 27 symbol_file: "libEGL.map.txt", 28 first_version: "9", 29 unversioned_until: "current", 30} 31 32ndk_library { 33 name: "libGLESv1_CM", 34 symbol_file: "libGLESv1_CM.map.txt", 35 first_version: "9", 36 unversioned_until: "current", 37} 38 39ndk_library { 40 name: "libGLESv2", 41 symbol_file: "libGLESv2.map.txt", 42 first_version: "9", 43 unversioned_until: "current", 44} 45 46ndk_library { 47 name: "libGLESv3", 48 symbol_file: "libGLESv3.map.txt", 49 first_version: "18", 50 unversioned_until: "current", 51} 52 53cc_defaults { 54 name: "gl_libs_defaults", 55 cflags: [ 56 "-DGL_GLEXT_PROTOTYPES", 57 "-DEGL_EGLEXT_PROTOTYPES", 58 "-fvisibility=hidden", 59 ], 60 shared_libs: [ 61 // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** 62 // In particular, DO NOT add libutils or anything "above" libcutils 63 "libcutils", 64 "liblog", 65 "libdl", 66 ], 67 68 // we need to access the private Bionic header <bionic_tls.h> 69 include_dirs: ["bionic/libc/private"], 70} 71 72//############################################################################## 73// Build META EGL library 74// 75cc_defaults { 76 name: "egl_libs_defaults", 77 defaults: ["gl_libs_defaults"], 78 cflags: [ 79 "-DLOG_TAG=\"libEGL\"", 80 ], 81 shared_libs: [ 82 // ***** DO NOT ADD NEW DEPENDENCIES HERE ***** 83 // In particular, DO NOT add libutils nor anything "above" libui 84 "libui", 85 "libnativewindow", 86 "libbacktrace", 87 ], 88} 89 90cc_library_static { 91 name: "libEGL_getProcAddress", 92 defaults: ["egl_libs_defaults"], 93 srcs: ["EGL/getProcAddress.cpp"], 94 arch: { 95 arm: { 96 instruction_set: "arm", 97 }, 98 }, 99} 100 101cc_library_shared { 102 name: "libEGL", 103 defaults: ["egl_libs_defaults"], 104 srcs: [ 105 "EGL/egl_tls.cpp", 106 "EGL/egl_cache.cpp", 107 "EGL/egl_display.cpp", 108 "EGL/egl_object.cpp", 109 "EGL/egl.cpp", 110 "EGL/eglApi.cpp", 111 "EGL/Loader.cpp", 112 "EGL/BlobCache.cpp", 113 ], 114 shared_libs: ["libvndksupport"], 115 static_libs: ["libEGL_getProcAddress"], 116 ldflags: ["-Wl,--exclude-libs=ALL"], 117 export_include_dirs: ["EGL/include"], 118} 119 120cc_test { 121 name: "libEGL_test", 122 defaults: ["egl_libs_defaults"], 123 srcs: [ 124 "EGL/BlobCache.cpp", 125 "EGL/BlobCache_test.cpp", 126 ], 127} 128 129cc_defaults { 130 name: "gles_libs_defaults", 131 defaults: ["gl_libs_defaults"], 132 arch: { 133 arm: { 134 instruction_set: "arm", 135 136 // TODO: This is to work around b/20093774. Remove after root cause is fixed 137 ldflags: ["-Wl,--hash-style,both"], 138 }, 139 }, 140 shared_libs: ["libEGL"], 141} 142 143//############################################################################## 144// Build the wrapper OpenGL ES 1.x library 145// 146cc_library_shared { 147 name: "libGLESv1_CM", 148 defaults: ["gles_libs_defaults"], 149 srcs: ["GLES_CM/gl.cpp"], 150 cflags: ["-DLOG_TAG=\"libGLESv1\""], 151} 152 153//############################################################################## 154// Build the wrapper OpenGL ES 2.x library 155// 156cc_library_shared { 157 name: "libGLESv2", 158 defaults: ["gles_libs_defaults"], 159 srcs: ["GLES2/gl2.cpp"], 160 cflags: ["-DLOG_TAG=\"libGLESv2\""], 161} 162 163//############################################################################## 164// Build the wrapper OpenGL ES 3.x library (this is just different name for v2) 165// 166cc_library_shared { 167 name: "libGLESv3", 168 defaults: ["gles_libs_defaults"], 169 srcs: ["GLES2/gl2.cpp"], 170 cflags: ["-DLOG_TAG=\"libGLESv3\""], 171} 172