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 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21bootstat_lib_src_files = [ 22 "boot_event_record_store.cpp", 23] 24 25cc_defaults { 26 name: "bootstat_defaults", 27 28 cflags: [ 29 "-Wall", 30 "-Wextra", 31 "-Werror", 32 ], 33 shared_libs: [ 34 "libbase", 35 "libcutils", 36 "liblog", 37 ], 38 header_libs: ["libgtest_prod_headers"], 39} 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"], 70 shared_libs: [ 71 "libstatslog" 72 ], 73 init_rc: ["bootstat.rc"], 74 product_variables: { 75 pdk: { 76 enabled: false, 77 }, 78 debuggable: { 79 init_rc: ["bootstat-debug.rc"], 80 }, 81 }, 82 srcs: ["bootstat.cpp"], 83} 84 85// Native tests 86// ----------------------------------------------------------------------------- 87cc_test { 88 name: "bootstat_tests", 89 test_suites: ["device-tests"], 90 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", 98 "testrunner.cpp", 99 ], 100 test_options: { 101 unit_test: true, 102 }, 103} 104