blob: 545a06f2005098dc7c5916d3bb8ce71f1f5f3500 [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 ],
Howard Rofe0b3892020-01-31 17:37:32 -080038 static_libs: ["libgtest_prod"],
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: {
Logan Chien4892bbf2018-02-13 18:08:53 +080075 pdk: {
76 enabled: false,
77 },
Mark Salyzyn9a387042017-10-10 14:57:12 -070078 debuggable: {
79 init_rc: ["bootstat-debug.rc"],
80 },
81 },
Dan Willemsen194edf72016-08-26 15:01:36 -070082 srcs: ["bootstat.cpp"],
83}
84
85// Native tests
86// -----------------------------------------------------------------------------
87cc_test {
88 name: "bootstat_tests",
Dan Shi0f0cccc2017-03-31 17:13:04 -070089 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -070090 defaults: ["bootstat_defaults"],
91 host_supported: true,
92 static_libs: [
93 "libbootstat_debug",
94 "libgmock",
95 ],
96 srcs: [
97 "boot_event_record_store_test.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070098 "testrunner.cpp",
99 ],
Julien Desprez2c8cb012021-02-05 09:22:05 -0800100 test_options: {
101 unit_test: true,
102 },
Dan Willemsen194edf72016-08-26 15:01:36 -0700103}