1package {
2    default_applicable_licenses: ["system_core_libutils_license"],
3}
4
5cc_defaults {
6    name: "libutils_binder_impl_defaults_nodeps",
7    defaults: [
8        "libutils_defaults_nodeps",
9        "apex-lowest-min-sdk-version",
10    ],
11    native_bridge_supported: true,
12
13    export_include_dirs: ["include"],
14    srcs: [
15        "Errors.cpp",
16        "RefBase.cpp",
17        "SharedBuffer.cpp",
18        "String16.cpp",
19        "String8.cpp",
20        "StrongPointer.cpp",
21        "Unicode.cpp",
22        "VectorImpl.cpp",
23    ],
24
25    cflags: [
26        "-Winvalid-offsetof",
27        "-Wsequence-point",
28        "-Wzero-as-null-pointer-constant",
29    ],
30
31    apex_available: [
32        "//apex_available:anyapex",
33        "//apex_available:platform",
34    ],
35
36    afdo: true,
37}
38
39cc_defaults {
40    name: "libutils_binder_impl_defaults",
41    defaults: [
42        "libutils_defaults",
43        "libutils_binder_impl_defaults_nodeps",
44    ],
45}
46
47cc_library {
48    name: "libutils_binder",
49    defaults: ["libutils_binder_impl_defaults"],
50    cmake_snapshot_supported: false,
51}
52
53cc_library_shared {
54    name: "libutils_binder_sdk",
55    defaults: ["libutils_binder_impl_defaults_nodeps"],
56    cmake_snapshot_supported: true,
57
58    header_libs: [
59        "liblog_stub",
60    ],
61
62    cflags: [
63        "-DANDROID_LOG_STUB_WEAK_PRINT",
64        "-DANDROID_UTILS_CALLSTACK_ENABLED=0",
65    ],
66}
67
68cc_library {
69    name: "libutils_binder_test_compile",
70    defaults: ["libutils_binder_impl_defaults"],
71
72    cflags: [
73        "-DDEBUG_REFS=1",
74    ],
75
76    visibility: [":__subpackages__"],
77}
78
79cc_fuzz {
80    name: "libutils_fuzz_string8",
81    defaults: ["libutils_fuzz_defaults"],
82    srcs: ["String8_fuzz.cpp"],
83}
84
85cc_fuzz {
86    name: "libutils_fuzz_string16",
87    defaults: ["libutils_fuzz_defaults"],
88    srcs: ["String16_fuzz.cpp"],
89}
90
91cc_fuzz {
92    name: "libutils_fuzz_vector",
93    defaults: ["libutils_fuzz_defaults"],
94    srcs: ["Vector_fuzz.cpp"],
95}
96
97cc_fuzz {
98    name: "libutils_fuzz_refbase",
99    defaults: ["libutils_fuzz_defaults"],
100    srcs: ["RefBase_fuzz.cpp"],
101}
102
103cc_test {
104    name: "libutils_binder_test",
105    host_supported: true,
106
107    srcs: [
108        "Errors_test.cpp",
109        "SharedBuffer_test.cpp",
110        "String16_test.cpp",
111        "String8_test.cpp",
112        "StrongPointer_test.cpp",
113        "Unicode_test.cpp",
114        "Vector_test.cpp",
115    ],
116
117    target: {
118        android: {
119            shared_libs: [
120                "libbase",
121                "libcutils",
122                "liblog",
123                "liblzma",
124                "libutils", // which includes libutils_binder
125                "libz",
126            ],
127        },
128        linux: {
129            srcs: [
130                "RefBase_test.cpp",
131            ],
132        },
133        host: {
134            static_libs: [
135                "libbase",
136                "liblog",
137                "liblzma",
138                "libutils", // which includes libutils_binder
139            ],
140        },
141    },
142
143    cflags: [
144        "-Wall",
145        "-Wextra",
146        "-Werror",
147        "-Wthread-safety",
148    ],
149
150    test_suites: ["device-tests"],
151}
152
153cc_benchmark {
154    name: "libutils_binder_benchmark",
155    srcs: ["Vector_benchmark.cpp"],
156    shared_libs: ["libutils"],
157}
158