support.bp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. cc_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. // Generate custom headers
  11. gensrcs {
  12. name: "rs_generated_headers_support",
  13. tools: ["rsg-generator"],
  14. tool_files: [
  15. "rs.spec",
  16. "rs_compat.spec",
  17. ],
  18. cmd: "cat $(location rs.spec) $(location rs_compat.spec) | $(location rsg-generator) $(in) $(out)",
  19. output_extension: "h",
  20. srcs: [
  21. "rsgApiStructs.h_rsg",
  22. "rsgApiFuncDecl.h_rsg",
  23. ],
  24. export_include_dirs: ["."],
  25. }
  26. gensrcs {
  27. name: "rs_generated_sources_support",
  28. tools: ["rsg-generator"],
  29. tool_files: [
  30. "rs.spec",
  31. "rs_compat.spec",
  32. ],
  33. cmd: "cat $(location rs.spec) $(location rs_compat.spec) | $(location rsg-generator) $(in) $(out)",
  34. output_extension: "cpp",
  35. srcs: [
  36. "rsgApi.cpp_rsg",
  37. "rsgApiReplay.cpp_rsg",
  38. ],
  39. }
  40. cc_library_shared {
  41. name: "libRSSupport",
  42. defaults: ["rs_support_defaults"],
  43. sdk_version: "9",
  44. srcs: [
  45. "rsAllocation.cpp",
  46. "rsApiAllocation.cpp",
  47. "rsApiContext.cpp",
  48. "rsApiDevice.cpp",
  49. "rsApiElement.cpp",
  50. "rsApiType.cpp",
  51. "rsClosure.cpp",
  52. "rsComponent.cpp",
  53. "rsContext.cpp",
  54. "rsCppUtils.cpp",
  55. "rsDevice.cpp",
  56. "rsDriverLoader.cpp",
  57. "rsElement.cpp",
  58. "rsFifoSocket.cpp",
  59. "rsObjectBase.cpp",
  60. "rsMatrix2x2.cpp",
  61. "rsMatrix3x3.cpp",
  62. "rsMatrix4x4.cpp",
  63. "rsMutex.cpp",
  64. "rsSampler.cpp",
  65. "rsScript.cpp",
  66. "rsScriptC.cpp",
  67. "rsScriptC_Lib.cpp",
  68. "rsScriptGroup.cpp",
  69. "rsScriptGroup2.cpp",
  70. "rsScriptIntrinsic.cpp",
  71. "rsSignal.cpp",
  72. "rsStream.cpp",
  73. "rsThreadIO.cpp",
  74. "rsType.cpp",
  75. "driver/rsdAllocation.cpp",
  76. "driver/rsdBcc.cpp",
  77. "driver/rsdCore.cpp",
  78. "driver/rsdElement.cpp",
  79. "driver/rsdRuntimeStubs.cpp",
  80. "driver/rsdSampler.cpp",
  81. "driver/rsdScriptGroup.cpp",
  82. "driver/rsdType.cpp",
  83. "cpu_ref/rsCpuCore.cpp",
  84. "cpu_ref/rsCpuExecutable.cpp",
  85. "cpu_ref/rsCpuScript.cpp",
  86. "cpu_ref/rsCpuRuntimeMath.cpp",
  87. "cpu_ref/rsCpuScriptGroup.cpp",
  88. "cpu_ref/rsCpuScriptGroup2.cpp",
  89. "cpu_ref/rsCpuIntrinsic.cpp",
  90. "cpu_ref/rsCpuIntrinsic3DLUT.cpp",
  91. "cpu_ref/rsCpuIntrinsicBlend.cpp",
  92. "cpu_ref/rsCpuIntrinsicBlur.cpp",
  93. "cpu_ref/rsCpuIntrinsicBLAS.cpp",
  94. "cpu_ref/rsCpuIntrinsicColorMatrix.cpp",
  95. "cpu_ref/rsCpuIntrinsicConvolve3x3.cpp",
  96. "cpu_ref/rsCpuIntrinsicConvolve5x5.cpp",
  97. "cpu_ref/rsCpuIntrinsicHistogram.cpp",
  98. "cpu_ref/rsCpuIntrinsicLUT.cpp",
  99. "cpu_ref/rsCpuIntrinsicResize.cpp",
  100. "cpu_ref/rsCpuIntrinsicYuvToRGB.cpp",
  101. ],
  102. generated_sources: ["rs_generated_sources_support"],
  103. generated_headers: ["rs_generated_headers_support"],
  104. arch: {
  105. arm: {
  106. cflags: [
  107. "-DARCH_ARM_HAVE_VFP",
  108. "-DARCH_ARM_USE_INTRINSICS",
  109. ],
  110. asflags: ["-mfpu=neon"],
  111. srcs: [
  112. "cpu_ref/rsCpuIntrinsics_neon_3DLUT.S",
  113. "cpu_ref/rsCpuIntrinsics_neon_Blend.S",
  114. "cpu_ref/rsCpuIntrinsics_neon_Blur.S",
  115. "cpu_ref/rsCpuIntrinsics_neon_ColorMatrix.S",
  116. "cpu_ref/rsCpuIntrinsics_neon_Convolve.S",
  117. "cpu_ref/rsCpuIntrinsics_neon_Resize.S",
  118. "cpu_ref/rsCpuIntrinsics_neon_YuvToRGB.S",
  119. ],
  120. neon: {
  121. cflags: ["-DARCH_ARM_HAVE_NEON"]
  122. },
  123. },
  124. arm64: {
  125. cflags: [
  126. "-DARCH_ARM_USE_INTRINSICS",
  127. "-DARCH_ARM64_USE_INTRINSICS",
  128. "-DARCH_ARM64_HAVE_NEON",
  129. ],
  130. srcs: [
  131. "cpu_ref/rsCpuIntrinsics_advsimd_3DLUT.S",
  132. "cpu_ref/rsCpuIntrinsics_advsimd_Blend.S",
  133. "cpu_ref/rsCpuIntrinsics_advsimd_Blur.S",
  134. "cpu_ref/rsCpuIntrinsics_advsimd_ColorMatrix.S",
  135. "cpu_ref/rsCpuIntrinsics_advsimd_Convolve.S",
  136. "cpu_ref/rsCpuIntrinsics_advsimd_Resize.S",
  137. "cpu_ref/rsCpuIntrinsics_advsimd_YuvToRGB.S",
  138. ],
  139. },
  140. x86: {
  141. cflags: ["-DARCH_X86_HAVE_SSSE3"],
  142. srcs: ["cpu_ref/rsCpuIntrinsics_x86.cpp"],
  143. },
  144. x86_64: {
  145. cflags: ["-DARCH_X86_HAVE_SSSE3"],
  146. srcs: ["cpu_ref/rsCpuIntrinsics_x86.cpp"],
  147. },
  148. },
  149. required: ["libblasV8"],
  150. static_libs: ["libbnnmlowpV8"],
  151. shared_libs: [
  152. "liblog",
  153. "libdl",
  154. ],
  155. ldflags: [
  156. "-Wl,--exclude-libs,libc++_static.a",
  157. "-Wl,--hash-style=sysv",
  158. ],
  159. stl: "c++_static",
  160. cflags: [
  161. "-Werror",
  162. "-Wall",
  163. "-Wextra",
  164. "-Wno-unused-parameter",
  165. "-Wno-unused-variable",
  166. "-Wno-overloaded-virtual",
  167. "-DRS_COMPATIBILITY_LIB",
  168. "-DGEMMLOWP_USE_STLPORT",
  169. // TODO: why isn't this picked up from the host GLOBAL_CFLAGS?
  170. "-D__STDC_FORMAT_MACROS",
  171. // Allow implicit fallthrough in rsContext.cpp:414 until it is fixed.
  172. "-Wno-error=implicit-fallthrough",
  173. ],
  174. }