blob: 89b459865b1c89a5ffd22450cfeb86867518448c [file] [log] [blame]
Dan Willemsen194edf72016-08-26 15:01:36 -07001//
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
17bootstat_lib_src_files = [
18 "boot_event_record_store.cpp",
19 "event_log_list_builder.cpp",
20 "histogram_logger.cpp",
21 "uptime_parser.cpp",
22]
23
24cc_defaults {
25 name: "bootstat_defaults",
26
27 cflags: [
28 "-Wall",
29 "-Wextra",
30 "-Werror",
31
32 // 524291 corresponds to sysui_histogram, from
33 // frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
34 "-DHISTOGRAM_LOG_TAG=524291",
35 ],
36 shared_libs: [
37 "libbase",
38 "libcutils",
39 "liblog",
40 ],
41 whole_static_libs: ["libgtest_prod"],
42 // Clang is required because of C++14
43 clang: true,
44}
45
46// bootstat static library
47// -----------------------------------------------------------------------------
48cc_library_static {
49 name: "libbootstat",
50 defaults: ["bootstat_defaults"],
51 srcs: bootstat_lib_src_files,
52}
53
54// bootstat static library, debug
55// -----------------------------------------------------------------------------
56cc_library_static {
57 name: "libbootstat_debug",
58 defaults: ["bootstat_defaults"],
59 host_supported: true,
60 srcs: bootstat_lib_src_files,
61
62 target: {
63 host: {
64 cflags: ["-UNDEBUG"],
65 },
66 },
67}
68
69// bootstat binary
70// -----------------------------------------------------------------------------
71cc_binary {
72 name: "bootstat",
73 defaults: ["bootstat_defaults"],
74 static_libs: ["libbootstat"],
75 init_rc: ["bootstat.rc"],
76 srcs: ["bootstat.cpp"],
77}
78
79// Native tests
80// -----------------------------------------------------------------------------
81cc_test {
82 name: "bootstat_tests",
83 defaults: ["bootstat_defaults"],
84 host_supported: true,
85 static_libs: [
86 "libbootstat_debug",
87 "libgmock",
88 ],
89 srcs: [
90 "boot_event_record_store_test.cpp",
91 "event_log_list_builder_test.cpp",
92 "testrunner.cpp",
93 ],
94}