xref: /aosp_15_r20/system/core/bootstat/Android.bp (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1//
2// Copyright (C) 2016 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21bootstat_lib_src_files = [
22    "boot_event_record_store.cpp",
23]
24
25cc_defaults {
26    name: "bootstat_defaults",
27
28    cflags: [
29        "-Wall",
30        "-Wextra",
31        "-Werror",
32    ],
33    shared_libs: [
34        "libbase",
35        "libcutils",
36        "liblog",
37    ],
38    header_libs: ["libgtest_prod_headers"],
39}
40
41// bootstat static library
42// -----------------------------------------------------------------------------
43cc_library_static {
44    name: "libbootstat",
45    defaults: ["bootstat_defaults"],
46    srcs: bootstat_lib_src_files,
47}
48
49// bootstat static library, debug
50// -----------------------------------------------------------------------------
51cc_library_static {
52    name: "libbootstat_debug",
53    defaults: ["bootstat_defaults"],
54    host_supported: true,
55    srcs: bootstat_lib_src_files,
56
57    target: {
58        host: {
59            cflags: ["-UNDEBUG"],
60        },
61    },
62}
63
64// bootstat binary
65// -----------------------------------------------------------------------------
66cc_binary {
67    name: "bootstat",
68    defaults: ["bootstat_defaults"],
69    static_libs: ["libbootstat"],
70    shared_libs: [
71        "libstatslog"
72    ],
73    init_rc: ["bootstat.rc"],
74    product_variables: {
75        debuggable: {
76            init_rc: ["bootstat-debug.rc"],
77        },
78    },
79    srcs: ["bootstat.cpp"],
80}
81
82// Native tests
83// -----------------------------------------------------------------------------
84cc_test {
85    name: "bootstat_tests",
86    test_suites: ["device-tests"],
87    defaults: ["bootstat_defaults"],
88    host_supported: true,
89    static_libs: [
90        "libbootstat_debug",
91        "libgmock",
92    ],
93    srcs: [
94        "boot_event_record_store_test.cpp",
95        "testrunner.cpp",
96    ],
97    test_options: {
98        unit_test: true,
99    },
100}
101