• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5cc_library_headers {
6    name: "rs-headers",
7    export_include_dirs: ["."],
8    sdk_version: "9",
9}
10
11cc_defaults {
12    name: "rs_defaults",
13    cflags: [
14        "-Werror",
15        "-Wall",
16        "-Wextra",
17        "-Wno-deprecated-declarations",
18        "-Wno-unused-parameter",
19        "-Wno-unused-variable",
20    ],
21}
22
23cc_library_shared {
24    name: "libRSDriver",
25    vendor_available: true,
26    native_bridge_supported: true,
27    vndk: {
28        enabled: true,
29        support_system_process: true,
30    },
31    defaults: ["rs_defaults"],
32
33    srcs: [
34        "driver/rsdAllocation.cpp",
35        "driver/rsdBcc.cpp",
36        "driver/rsdCore.cpp",
37        "driver/rsdElement.cpp",
38        "driver/rsdFrameBuffer.cpp",
39        "driver/rsdFrameBufferObj.cpp",
40        "driver/rsdGL.cpp",
41        "driver/rsdMesh.cpp",
42        "driver/rsdMeshObj.cpp",
43        "driver/rsdProgram.cpp",
44        "driver/rsdProgramRaster.cpp",
45        "driver/rsdProgramStore.cpp",
46        "driver/rsdRuntimeStubs.cpp",
47        "driver/rsdSampler.cpp",
48        "driver/rsdScriptGroup.cpp",
49        "driver/rsdShader.cpp",
50        "driver/rsdShaderCache.cpp",
51        "driver/rsdType.cpp",
52        "driver/rsdVertexArray.cpp",
53    ],
54
55    shared_libs: [
56        "libRS_internal",
57        "libRSCpuRef",
58
59        "liblog",
60        "libEGL",
61        "libGLESv1_CM",
62        "libGLESv2",
63
64        "libnativewindow",
65
66        "libbcinfo",
67    ],
68
69    static_libs: ["libarect"],
70
71    header_libs: [
72        "libcutils_headers",
73        "libutils_headers",
74        "libnativebase_headers",
75    ],
76
77    product_variables: {
78        pdk: {
79            enabled: false,
80        },
81    },
82
83    // Bug: http://b/77445194 - Disable x86 asan where rsdRuntimeStubs.cpp has
84    // undefined reference to half-conversion routines (__gnu_h2f_ieee,
85    // __gnu_f2h_ieee).
86    arch: {
87        x86: {
88            sanitize: {
89                never: true,
90            },
91        },
92    },
93
94    target: {
95        native_bridge : {
96            header_libs: [
97                "libnativewindow_headers",
98                "media_ndk_headers",
99            ],
100            shared_libs: [
101                "libnative_bridge_guest_libEGL",
102                "libnative_bridge_guest_libGLESv1_CM",
103                "libnative_bridge_guest_libGLESv2",
104                "libnative_bridge_guest_libnativewindow",
105            ],
106            exclude_shared_libs: [
107                "libEGL",
108                "libGLESv1_CM",
109                "libGLESv2",
110                "libnativewindow",
111            ],
112        },
113    },
114}
115
116// Build rsg-generator ====================
117
118cc_binary_host {
119    name: "rsg-generator",
120
121    srcs: [
122        "spec.l",
123        "rsg_generator.c",
124    ],
125
126    cflags: [
127        "-Wno-unused-function",
128    ],
129
130    stl: "none",
131    sanitize: {
132        never: true,
133    },
134}
135
136// Generate custom headers
137gensrcs {
138    name: "rs_generated_headers",
139    tools: ["rsg-generator"],
140    tool_files: [
141        "rs.spec",
142        "rsg.spec",
143    ],
144    cmd: "cat $(location rs.spec) $(location rsg.spec) | $(location rsg-generator) $(in) $(out)",
145    output_extension: "h",
146    srcs: [
147        "rsgApiStructs.h_rsg",
148        "rsgApiFuncDecl.h_rsg",
149    ],
150    export_include_dirs: ["."],
151}
152
153gensrcs {
154    name: "rs_generated_sources",
155    tools: ["rsg-generator"],
156    tool_files: [
157        "rs.spec",
158        "rsg.spec",
159    ],
160    cmd: "cat $(location rs.spec) $(location rsg.spec) | $(location rsg-generator) $(in) $(out)",
161    output_extension: "cpp",
162    srcs: [
163        "rsgApi.cpp_rsg",
164        "rsgApiReplay.cpp_rsg",
165    ],
166}
167
168cc_library_shared {
169    name: "libRS_internal",
170    vendor_available: true,
171    native_bridge_supported: true,
172    vndk: {
173        enabled: true,
174        support_system_process: true,
175    },
176    defaults: ["rs_defaults"],
177
178    srcs: [
179        "rsApiAllocation.cpp",
180        "rsApiContext.cpp",
181        "rsApiDevice.cpp",
182        "rsApiElement.cpp",
183        "rsApiFileA3D.cpp",
184        "rsApiMesh.cpp",
185        "rsApiType.cpp",
186        "rsAllocation.cpp",
187        "rsAnimation.cpp",
188        "rsComponent.cpp",
189        "rsContext.cpp",
190        "rsClosure.cpp",
191        "rsCppUtils.cpp",
192        "rsDevice.cpp",
193        "rsDriverLoader.cpp",
194        "rsElement.cpp",
195        "rsFBOCache.cpp",
196        "rsFifoSocket.cpp",
197        "rsFileA3D.cpp",
198        "rsFont.cpp",
199        "rsGrallocConsumer.cpp",
200        "rsObjectBase.cpp",
201        "rsMatrix2x2.cpp",
202        "rsMatrix3x3.cpp",
203        "rsMatrix4x4.cpp",
204        "rsMesh.cpp",
205        "rsMutex.cpp",
206        "rsProgram.cpp",
207        "rsProgramFragment.cpp",
208        "rsProgramStore.cpp",
209        "rsProgramRaster.cpp",
210        "rsProgramVertex.cpp",
211        "rsSampler.cpp",
212        "rsScript.cpp",
213        "rsScriptC.cpp",
214        "rsScriptC_Lib.cpp",
215        "rsScriptC_LibGL.cpp",
216        "rsScriptGroup.cpp",
217        "rsScriptGroup2.cpp",
218        "rsScriptIntrinsic.cpp",
219        "rsSignal.cpp",
220        "rsStream.cpp",
221        "rsThreadIO.cpp",
222        "rsType.cpp",
223    ],
224
225    generated_sources: ["rs_generated_sources"],
226    generated_headers: ["rs_generated_headers"],
227
228    shared_libs: [
229        "liblog",
230        "libutilscallstack",
231        "libutils",
232        "libEGL",
233        "libGLESv1_CM",
234        "libGLESv2",
235
236        "libdl",
237        "libnativewindow",
238
239        "libft2",
240
241        "libbcinfo",
242        "libmediandk",
243    ],
244
245    static_libs: ["libarect"],
246
247    // These runtime modules, including libcompiler_rt.so, are required for
248    // RenderScript.
249    required: [
250        "libclcore.bc",
251        "libclcore_debug.bc",
252        "libclcore_debug_g.bc",
253        "libclcore_g.bc",
254        "libcompiler_rt",
255    ],
256
257    arch: {
258        x86: {
259            required: ["libclcore_x86.bc"],
260        },
261        x86_64: {
262            required: ["libclcore_x86.bc"],
263        },
264
265        arm: {
266            neon: {
267                required: ["libclcore_neon.bc"],
268            },
269        },
270    },
271
272    product_variables: {
273        override_rs_driver: {
274            cflags: ["-DOVERRIDE_RS_DRIVER=%s"],
275        },
276        pdk: {
277            enabled: false,
278        },
279    },
280
281    target: {
282        native_bridge: {
283            header_libs: [
284                "libnativewindow_headers",
285                "media_ndk_headers",
286            ],
287            shared_libs: [
288                "libnative_bridge_guest_libEGL",
289                "libnative_bridge_guest_libGLESv1_CM",
290                "libnative_bridge_guest_libGLESv2",
291                "libnative_bridge_guest_libmediandk",
292                "libnative_bridge_guest_libnativewindow",
293            ],
294            exclude_shared_libs: [
295                "libEGL",
296                "libGLESv1_CM",
297                "libGLESv2",
298                "libmediandk",
299                "libnativewindow",
300            ],
301        },
302    },
303}
304
305cc_library_shared {
306    name: "libRS",
307    defaults: ["rs_defaults"],
308    native_bridge_supported: true,
309    llndk: {
310        symbol_file: "libRS.map",
311    },
312    srcs: [
313        "rsApiStubs.cpp",
314        "rsHidlAdaptation.cpp",
315        "rsFallbackAdaptation.cpp",
316    ],
317
318    // Default CPU fallback
319    required: [
320        "libRS_internal",
321        "libRSDriver",
322        "libRSCacheDir",
323    ],
324
325    // Treble configuration
326    shared_libs: [
327        "libhidlbase",
328        "libutilscallstack",
329        "libutils",
330        "android.hardware.renderscript@1.0",
331
332        "liblog",
333        "libcutils",
334    ],
335
336    product_variables: {
337        pdk: {
338            enabled: false,
339        },
340    },
341
342    static_libs: ["libRSDispatch"],
343
344    version_script: "libRS.map",
345}
346
347cc_library_shared {
348    name: "libRSCacheDir",
349    defaults: ["rs_defaults"],
350
351    srcs: ["rsCacheDir.cpp"],
352    shared_libs: [
353        "libandroid_runtime",
354        "liblog",
355    ],
356
357    product_variables: {
358        pdk: {
359            enabled: false,
360        },
361    },
362}
363
364build = [
365    "support.bp",
366]
367
368subdirs = [
369    "cpp",
370    "cpu_ref",
371    "script_api",
372    "support",
373]
374