1package {
2    default_team: "trendy_team_android_kernel",
3    default_applicable_licenses: ["test_dittosuite_license"],
4}
5
6// See: http://go/android-license-faq
7license {
8    name: "test_dittosuite_license",
9    visibility: [":__subpackages__"],
10    license_kinds: [
11        "SPDX-license-identifier-Apache-2.0",
12    ],
13    license_text: [
14        "LICENSE",
15    ],
16}
17
18cc_defaults {
19    name: "dittobench_defaults",
20    local_include_dirs: [
21        "test/include",
22        "include",
23    ],
24    generated_headers: ["dittosuite-proto"],
25    static_libs: [
26        "dittosuite-proto",
27        "libbase_ndk",
28        "libstorage",
29    ],
30    shared_libs: [
31        "libbinder",
32        "libcutils",
33        "liblog",
34        "libutils",
35        "libprotobuf-cpp-full",
36    ],
37    cflags: [
38        "-Wall",
39        "-Werror",
40        "-Wextra",
41        "-Wsign-compare",
42    ],
43    tidy: true,
44    /*
45      Silencing the tidy check warnings caused by
46      schema/benchmark.pb.h.
47    */
48    tidy_checks: [
49        "-bugprone-unhandled-self-assignment",
50        "-cert-msc32-c",
51        "-cert-msc51-cpp",
52        "-cert-oop54-cpp",
53    ],
54}
55
56filegroup {
57    name: "dittobench_benchmark_files",
58    srcs: [
59        "example/**/*.ditto",
60    ],
61}
62
63genrule {
64    name: "dittobench_gen_embedded_benchmarks",
65    cmd: "python3 $(location ditto2cpp.py) -o $(out) -s $(in)",
66    tool_files: [
67        "ditto2cpp.py",
68    ],
69    srcs: [
70        ":dittobench_benchmark_files",
71    ],
72    out: [
73        "generated/embedded_benchmarks.cpp",
74    ],
75}
76
77cc_library {
78    name: "libdittosuite",
79    srcs: [
80        "src/*.cpp",
81    ],
82    generated_sources: [
83        "dittobench_gen_embedded_benchmarks",
84    ],
85    defaults: ["dittobench_defaults"],
86}
87
88cc_binary {
89    name: "dittobench",
90    srcs: ["dittobench.cpp"],
91    static_libs: ["libdittosuite"],
92    defaults: ["dittobench_defaults"],
93}
94
95cc_benchmark {
96    name: "dittobench_benchmark",
97    srcs: ["dittobench_benchmark.cpp"],
98    static_libs: [
99        "libtestUtil",
100        "libdittosuite",
101    ],
102    shared_libs: [
103        "libbase",
104        "libcutils",
105        "libutils",
106        "liblog",
107    ],
108    data: ["example/**/*.ditto"],
109    test_suites: ["device-tests"],
110    defaults: ["dittobench_defaults"],
111}
112
113cc_binary {
114    name: "dittotrace",
115    srcs: ["dittotrace.cpp"],
116    static_libs: ["libdittosuite"],
117    defaults: ["dittobench_defaults"],
118}
119
120cc_test {
121    name: "dittobench_test",
122    srcs: [
123        "test/*.cpp",
124    ],
125    static_libs: [
126        "libdittosuite",
127        "libgmock",
128    ],
129    defaults: ["dittobench_defaults"],
130    data: ["example/*"],
131}
132