1cc_defaults { 2 name: "rs_support_defaults", 3 product_variables: { 4 unbundled_build: { 5 // Unbundled builds use prebuilts in prebuilts/sdk/renderscript instead 6 enabled: false, 7 }, 8 }, 9} 10 11// Generate custom headers 12gensrcs { 13 name: "rs_generated_headers_support", 14 tools: ["rsg-generator"], 15 tool_files: [ 16 "rs.spec", 17 "rs_compat.spec", 18 ], 19 cmd: "cat $(location rs.spec) $(location rs_compat.spec) | $(location rsg-generator) $(in) $(out)", 20 output_extension: "h", 21 srcs: [ 22 "rsgApiStructs.h_rsg", 23 "rsgApiFuncDecl.h_rsg", 24 ], 25 export_include_dirs: ["."], 26} 27 28gensrcs { 29 name: "rs_generated_sources_support", 30 tools: ["rsg-generator"], 31 tool_files: [ 32 "rs.spec", 33 "rs_compat.spec", 34 ], 35 cmd: "cat $(location rs.spec) $(location rs_compat.spec) | $(location rsg-generator) $(in) $(out)", 36 output_extension: "cpp", 37 srcs: [ 38 "rsgApi.cpp_rsg", 39 "rsgApiReplay.cpp_rsg", 40 ], 41} 42 43cc_defaults { 44 name: "libRSSupport_defaults", 45 defaults: ["rs_support_defaults"], 46 srcs: [ 47 "rsAllocation.cpp", 48 "rsApiAllocation.cpp", 49 "rsApiContext.cpp", 50 "rsApiDevice.cpp", 51 "rsApiElement.cpp", 52 "rsApiType.cpp", 53 "rsClosure.cpp", 54 "rsComponent.cpp", 55 "rsContext.cpp", 56 "rsCppUtils.cpp", 57 "rsDevice.cpp", 58 "rsDriverLoader.cpp", 59 "rsElement.cpp", 60 "rsFifoSocket.cpp", 61 "rsObjectBase.cpp", 62 "rsMatrix2x2.cpp", 63 "rsMatrix3x3.cpp", 64 "rsMatrix4x4.cpp", 65 "rsMutex.cpp", 66 "rsSampler.cpp", 67 "rsScript.cpp", 68 "rsScriptC.cpp", 69 "rsScriptC_Lib.cpp", 70 "rsScriptGroup.cpp", 71 "rsScriptGroup2.cpp", 72 "rsScriptIntrinsic.cpp", 73 "rsSignal.cpp", 74 "rsStream.cpp", 75 "rsThreadIO.cpp", 76 "rsType.cpp", 77 "driver/rsdAllocation.cpp", 78 "driver/rsdBcc.cpp", 79 "driver/rsdCore.cpp", 80 "driver/rsdElement.cpp", 81 "driver/rsdRuntimeStubs.cpp", 82 "driver/rsdSampler.cpp", 83 "driver/rsdScriptGroup.cpp", 84 "driver/rsdType.cpp", 85 "cpu_ref/rsCpuCore.cpp", 86 "cpu_ref/rsCpuExecutable.cpp", 87 "cpu_ref/rsCpuScript.cpp", 88 "cpu_ref/rsCpuRuntimeMath.cpp", 89 "cpu_ref/rsCpuScriptGroup.cpp", 90 "cpu_ref/rsCpuScriptGroup2.cpp", 91 "cpu_ref/rsCpuIntrinsic.cpp", 92 "cpu_ref/rsCpuIntrinsic3DLUT.cpp", 93 "cpu_ref/rsCpuIntrinsicBlend.cpp", 94 "cpu_ref/rsCpuIntrinsicBlur.cpp", 95 "cpu_ref/rsCpuIntrinsicBLAS.cpp", 96 "cpu_ref/rsCpuIntrinsicColorMatrix.cpp", 97 "cpu_ref/rsCpuIntrinsicConvolve3x3.cpp", 98 "cpu_ref/rsCpuIntrinsicConvolve5x5.cpp", 99 "cpu_ref/rsCpuIntrinsicHistogram.cpp", 100 "cpu_ref/rsCpuIntrinsicLUT.cpp", 101 "cpu_ref/rsCpuIntrinsicResize.cpp", 102 "cpu_ref/rsCpuIntrinsicYuvToRGB.cpp", 103 ], 104 105 generated_sources: ["rs_generated_sources_support"], 106 generated_headers: ["rs_generated_headers_support"], 107 108 arch: { 109 arm: { 110 cflags: [ 111 "-DARCH_ARM_HAVE_VFP", 112 "-DARCH_ARM_USE_INTRINSICS", 113 ], 114 asflags: ["-mfpu=neon"], 115 srcs: [ 116 "cpu_ref/rsCpuIntrinsics_neon_3DLUT.S", 117 "cpu_ref/rsCpuIntrinsics_neon_Blend.S", 118 "cpu_ref/rsCpuIntrinsics_neon_Blur.S", 119 "cpu_ref/rsCpuIntrinsics_neon_ColorMatrix.S", 120 "cpu_ref/rsCpuIntrinsics_neon_Convolve.S", 121 "cpu_ref/rsCpuIntrinsics_neon_Resize.S", 122 "cpu_ref/rsCpuIntrinsics_neon_YuvToRGB.S", 123 ], 124 125 neon: { 126 cflags: ["-DARCH_ARM_HAVE_NEON"] 127 }, 128 }, 129 130 arm64: { 131 cflags: [ 132 "-DARCH_ARM_USE_INTRINSICS", 133 "-DARCH_ARM64_USE_INTRINSICS", 134 "-DARCH_ARM64_HAVE_NEON", 135 ], 136 srcs: [ 137 "cpu_ref/rsCpuIntrinsics_advsimd_3DLUT.S", 138 "cpu_ref/rsCpuIntrinsics_advsimd_Blend.S", 139 "cpu_ref/rsCpuIntrinsics_advsimd_Blur.S", 140 "cpu_ref/rsCpuIntrinsics_advsimd_ColorMatrix.S", 141 "cpu_ref/rsCpuIntrinsics_advsimd_Convolve.S", 142 "cpu_ref/rsCpuIntrinsics_advsimd_Resize.S", 143 "cpu_ref/rsCpuIntrinsics_advsimd_YuvToRGB.S", 144 ], 145 }, 146 147 x86: { 148 cflags: ["-DARCH_X86_HAVE_SSSE3"], 149 srcs: ["cpu_ref/rsCpuIntrinsics_x86.cpp"], 150 }, 151 152 x86_64: { 153 cflags: ["-DARCH_X86_HAVE_SSSE3"], 154 srcs: ["cpu_ref/rsCpuIntrinsics_x86.cpp"], 155 }, 156 }, 157 158 required: ["libblasV8"], 159 static_libs: ["libbnnmlowpV8"], 160 shared_libs: [ 161 "liblog", 162 "libdl", 163 ], 164 ldflags: [ 165 "-Wl,--exclude-libs,libc++_static.a", 166 "-Wl,--hash-style=sysv", 167 ], 168 stl: "c++_static", 169 170 cflags: [ 171 "-Werror", 172 "-Wall", 173 "-Wextra", 174 "-Wno-unused-parameter", 175 "-Wno-unused-variable", 176 "-Wno-overloaded-virtual", 177 "-DRS_COMPATIBILITY_LIB", 178 179 "-DGEMMLOWP_USE_STLPORT", 180 // TODO: why isn't this picked up from the host GLOBAL_CFLAGS? 181 "-D__STDC_FORMAT_MACROS", 182 183 // Allow implicit fallthrough in rsContext.cpp:414 until it is fixed. 184 "-Wno-error=implicit-fallthrough", 185 ], 186} 187 188cc_library_shared { 189 name: "libRSSupport", 190 defaults: ["libRSSupport_defaults"], 191 sdk_version: "9", 192 193 target: { 194 platform: { 195 shared_libs: ["libnativewindow"], 196 }, 197 }, 198} 199 200// Note: libnative_bridge_guest libraries don't support "sdk_version" - and we 201// must use libnative_bridge_guest_libnativewindow instead of libnativewindow 202// when we are doing native_bridge build. 203cc_library_shared { 204 name: "libnative_bridge_guest_libRSSupport", 205 stem: "libRSSupport", 206 defaults: ["libRSSupport_defaults"], 207 208 // Import headers not provided by libnative_bridge_guest_libnativewindow. 209 header_libs: [ 210 "libarect_headers", 211 "libnativewindow_headers" 212 ], 213 214 shared_libs: [ 215 "libnative_bridge_guest_libnativewindow", 216 ], 217 218 enabled: false, 219 native_bridge_supported: true, 220 target: { 221 native_bridge: { 222 enabled: true, 223 } 224 }, 225} 226