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