Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 1 | // |
| 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 Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 19 | } |
| 20 | |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 21 | bootstat_lib_src_files = [ |
| 22 | "boot_event_record_store.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 23 | ] |
| 24 | |
| 25 | cc_defaults { |
| 26 | name: "bootstat_defaults", |
| 27 | |
| 28 | cflags: [ |
| 29 | "-Wall", |
| 30 | "-Wextra", |
| 31 | "-Werror", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 32 | ], |
| 33 | shared_libs: [ |
| 34 | "libbase", |
| 35 | "libcutils", |
| 36 | "liblog", |
| 37 | ], |
Elliott Hughes | 02a8324 | 2021-04-20 15:22:02 -0700 | [diff] [blame] | 38 | header_libs: ["libgtest_prod_headers"], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | // bootstat static library |
| 42 | // ----------------------------------------------------------------------------- |
| 43 | cc_library_static { |
| 44 | name: "libbootstat", |
| 45 | defaults: ["bootstat_defaults"], |
| 46 | srcs: bootstat_lib_src_files, |
| 47 | } |
| 48 | |
| 49 | // bootstat static library, debug |
| 50 | // ----------------------------------------------------------------------------- |
| 51 | cc_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 | // ----------------------------------------------------------------------------- |
| 66 | cc_binary { |
| 67 | name: "bootstat", |
| 68 | defaults: ["bootstat_defaults"], |
| 69 | static_libs: ["libbootstat"], |
Tej Singh | 4eacd38 | 2018-01-25 17:59:57 -0800 | [diff] [blame] | 70 | shared_libs: [ |
Tej Singh | 4eacd38 | 2018-01-25 17:59:57 -0800 | [diff] [blame] | 71 | "libstatslog" |
| 72 | ], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 73 | init_rc: ["bootstat.rc"], |
Mark Salyzyn | 9a38704 | 2017-10-10 14:57:12 -0700 | [diff] [blame] | 74 | product_variables: { |
| 75 | debuggable: { |
| 76 | init_rc: ["bootstat-debug.rc"], |
| 77 | }, |
| 78 | }, |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 79 | srcs: ["bootstat.cpp"], |
| 80 | } |
| 81 | |
| 82 | // Native tests |
| 83 | // ----------------------------------------------------------------------------- |
| 84 | cc_test { |
| 85 | name: "bootstat_tests", |
Dan Shi | 0f0cccc | 2017-03-31 17:13:04 -0700 | [diff] [blame] | 86 | test_suites: ["device-tests"], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 87 | 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 Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 95 | "testrunner.cpp", |
| 96 | ], |
Julien Desprez | 2c8cb01 | 2021-02-05 09:22:05 -0800 | [diff] [blame] | 97 | test_options: { |
| 98 | unit_test: true, |
| 99 | }, |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 100 | } |