blob: 0c8760c2d1b4d79c9614dc50d5be2721ff5a6ac1 [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
Bob Badourd69ad692021-02-16 19:02:14 -080017package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Dan Willemsen194edf72016-08-26 15:01:36 -070021bootstat_lib_src_files = [
22 "boot_event_record_store.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070023]
24
25cc_defaults {
26 name: "bootstat_defaults",
27
28 cflags: [
29 "-Wall",
30 "-Wextra",
31 "-Werror",
Dan Willemsen194edf72016-08-26 15:01:36 -070032 ],
33 shared_libs: [
34 "libbase",
35 "libcutils",
36 "liblog",
37 ],
Elliott Hughes02a83242021-04-20 15:22:02 -070038 header_libs: ["libgtest_prod_headers"],
Dan Willemsen194edf72016-08-26 15:01:36 -070039}
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"],
Tej Singh4eacd382018-01-25 17:59:57 -080070 shared_libs: [
Tej Singh4eacd382018-01-25 17:59:57 -080071 "libstatslog"
72 ],
Dan Willemsen194edf72016-08-26 15:01:36 -070073 init_rc: ["bootstat.rc"],
Mark Salyzyn9a387042017-10-10 14:57:12 -070074 product_variables: {
75 debuggable: {
76 init_rc: ["bootstat-debug.rc"],
77 },
78 },
Dan Willemsen194edf72016-08-26 15:01:36 -070079 srcs: ["bootstat.cpp"],
80}
81
82// Native tests
83// -----------------------------------------------------------------------------
84cc_test {
85 name: "bootstat_tests",
Dan Shi0f0cccc2017-03-31 17:13:04 -070086 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -070087 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",
Dan Willemsen194edf72016-08-26 15:01:36 -070095 "testrunner.cpp",
96 ],
Julien Desprez2c8cb012021-02-05 09:22:05 -080097 test_options: {
98 unit_test: true,
99 },
Dan Willemsen194edf72016-08-26 15:01:36 -0700100}