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