huangcm
2025-08-14 5d6606c55520a76d5bb8297d83fd9bbf967e5244
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
cc_library_static {
    name: "libRSDispatch",
    vendor_available: true,
 
    srcs: ["rsDispatch.cpp"],
 
    include_dirs: [
        "frameworks/rs",
        "libnativehelper/include_jni",
    ],
 
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
        "-DRS_COMPATIBILITY_LIB",
    ],
 
 
    sdk_version: "9",
    shared_libs: ["libdl", "liblog"],
    // Used in librsjni, which is built as NDK code => no ASan.
    sanitize: {
        never: true,
    },
    stl: "none",
}
 
cc_defaults {
    name: "libRScpp-defaults",
    defaults: ["rs-version"],
 
    srcs: [
        "RenderScript.cpp",
        "BaseObj.cpp",
        "Element.cpp",
        "Type.cpp",
        "Allocation.cpp",
        "Script.cpp",
        "ScriptC.cpp",
        "ScriptIntrinsics.cpp",
        "ScriptIntrinsicBLAS.cpp",
        "Sampler.cpp",
 
        // TODO: make this not a symlink
        "rsCppUtils.cpp",
    ],
 
    cflags: [
        "-Werror",
        "-Wall",
        "-Wextra",
        "-Wno-unused-parameter",
        "-Wno-unused-variable",
    ],
 
    // We need to export not just rs/cpp but also rs.  This is because
    // RenderScript.h includes rsCppStructs.h, which includes rs/rsDefines.h.
    header_libs: ["rs-headers"],
    export_header_lib_headers: ["rs-headers"],
    export_include_dirs: ["."],
 
    shared_libs: [
        "libdl",
        "liblog",
        "libz",
    ],
}
 
cc_library {
    name: "libRScpp",
    defaults: ["libRScpp-defaults"],
 
    shared_libs: [
        "libgui",
        "libutils",
    ],
 
    static_libs: ["libRSDispatch"],
}
 
cc_library_static {
    name: "libRScpp_static",
    defaults: ["libRScpp-defaults"],
 
    cflags: ["-DRS_COMPATIBILITY_LIB"],
 
    sdk_version: "9",
    whole_static_libs: ["libRSDispatch"],
 
    ldflags: [
        "-Wl,--exclude-libs,libc++_static.a",
    ],
    stl: "c++_static",
}