blob: 7480e4905e2ef2f5aed53b0efdd71f64e9690510 [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 Badour187b7d12021-02-12 17:48:16 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "system_core_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["system_core_license"],
24}
25
Dan Willemsen194edf72016-08-26 15:01:36 -070026bootstat_lib_src_files = [
27 "boot_event_record_store.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070028]
29
30cc_defaults {
31 name: "bootstat_defaults",
32
33 cflags: [
34 "-Wall",
35 "-Wextra",
36 "-Werror",
Dan Willemsen194edf72016-08-26 15:01:36 -070037 ],
38 shared_libs: [
39 "libbase",
40 "libcutils",
41 "liblog",
42 ],
Howard Rofe0b3892020-01-31 17:37:32 -080043 static_libs: ["libgtest_prod"],
Dan Willemsen194edf72016-08-26 15:01:36 -070044}
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"],
Tej Singh4eacd382018-01-25 17:59:57 -080075 shared_libs: [
Tej Singh4eacd382018-01-25 17:59:57 -080076 "libstatslog"
77 ],
Dan Willemsen194edf72016-08-26 15:01:36 -070078 init_rc: ["bootstat.rc"],
Mark Salyzyn9a387042017-10-10 14:57:12 -070079 product_variables: {
Logan Chien4892bbf2018-02-13 18:08:53 +080080 pdk: {
81 enabled: false,
82 },
Mark Salyzyn9a387042017-10-10 14:57:12 -070083 debuggable: {
84 init_rc: ["bootstat-debug.rc"],
85 },
86 },
Dan Willemsen194edf72016-08-26 15:01:36 -070087 srcs: ["bootstat.cpp"],
88}
89
90// Native tests
91// -----------------------------------------------------------------------------
92cc_test {
93 name: "bootstat_tests",
Dan Shi0f0cccc2017-03-31 17:13:04 -070094 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -070095 defaults: ["bootstat_defaults"],
96 host_supported: true,
97 static_libs: [
98 "libbootstat_debug",
99 "libgmock",
100 ],
101 srcs: [
102 "boot_event_record_store_test.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -0700103 "testrunner.cpp",
104 ],
Julien Desprez2c8cb012021-02-05 09:22:05 -0800105 test_options: {
106 unit_test: true,
107 },
Dan Willemsen194edf72016-08-26 15:01:36 -0700108}