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 | |
| 17 | bootstat_lib_src_files = [ |
| 18 | "boot_event_record_store.cpp", |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 19 | "uptime_parser.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 20 | ] |
| 21 | |
| 22 | cc_defaults { |
| 23 | name: "bootstat_defaults", |
| 24 | |
| 25 | cflags: [ |
| 26 | "-Wall", |
| 27 | "-Wextra", |
| 28 | "-Werror", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 29 | ], |
| 30 | shared_libs: [ |
| 31 | "libbase", |
| 32 | "libcutils", |
| 33 | "liblog", |
James Hawkins | 9aec926 | 2017-01-31 11:42:24 -0800 | [diff] [blame] | 34 | "libmetricslogger", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 35 | ], |
| 36 | whole_static_libs: ["libgtest_prod"], |
| 37 | // Clang is required because of C++14 |
| 38 | clang: true, |
| 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"], |
| 70 | init_rc: ["bootstat.rc"], |
| 71 | srcs: ["bootstat.cpp"], |
| 72 | } |
| 73 | |
| 74 | // Native tests |
| 75 | // ----------------------------------------------------------------------------- |
| 76 | cc_test { |
| 77 | name: "bootstat_tests", |
| 78 | defaults: ["bootstat_defaults"], |
| 79 | host_supported: true, |
| 80 | static_libs: [ |
| 81 | "libbootstat_debug", |
| 82 | "libgmock", |
| 83 | ], |
| 84 | srcs: [ |
| 85 | "boot_event_record_store_test.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 86 | "testrunner.cpp", |
| 87 | ], |
| 88 | } |