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