1 2// 3// Copyright (C) 2023 The Android Open Source Project 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// 9// http://www.apache.org/licenses/LICENSE-2.0 10// 11// Unless required by applicable law or agreed to in writing, software 12// distributed under the License is distributed on an "AS IS" BASIS, 13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21cc_defaults { 22 name: "expresslog_defaults", 23 srcs: [ 24 "Counter.cpp", 25 "Histogram.cpp", 26 ], 27} 28 29cc_library { 30 name: "libexpresslog", 31 defaults: ["expresslog_defaults"], 32 cflags: [ 33 "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash", 34 "-Wall", 35 "-Werror", 36 ], 37 header_libs: [ 38 "libtextclassifier_hash_headers", 39 ], 40 static_libs: [ 41 "libstatslog_express", 42 "libtextclassifier_hash_static", 43 ], 44 shared_libs: [ 45 "libbase", 46 "liblog", 47 "libstatssocket", 48 ], 49 export_include_dirs: ["include"], 50} 51 52genrule { 53 name: "statslog_express.h", 54 tools: ["stats-log-api-gen"], 55 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_express.h --module expresslog --namespace android,expresslog", 56 out: [ 57 "statslog_express.h", 58 ], 59} 60 61genrule { 62 name: "statslog_express.cpp", 63 tools: ["stats-log-api-gen"], 64 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_express.cpp --module expresslog --namespace android,expresslog --importHeader statslog_express.h", 65 out: [ 66 "statslog_express.cpp", 67 ], 68} 69 70cc_library_static { 71 name: "libstatslog_express", 72 generated_sources: ["statslog_express.cpp"], 73 generated_headers: ["statslog_express.h"], 74 export_generated_headers: ["statslog_express.h"], 75 shared_libs: [ 76 "libstatssocket", 77 ], 78} 79 80cc_test { 81 name: "expresslog_test", 82 defaults: ["expresslog_defaults"], 83 test_suites: [ 84 "general-tests", 85 ], 86 srcs: [ 87 "tests/Histogram_test.cpp", 88 ], 89 local_include_dirs: [ 90 "include", 91 ], 92 cflags: [ 93 "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash", 94 "-Wall", 95 "-Wextra", 96 "-Wunused", 97 "-Wpedantic", 98 "-Werror", 99 ], 100 header_libs: [ 101 "libtextclassifier_hash_headers", 102 ], 103 static_libs: [ 104 "libgmock", 105 "libbase", 106 "liblog", 107 "libstatslog_express", 108 "libtextclassifier_hash_static", 109 ], 110 shared_libs: [ 111 "libstatssocket", 112 ] 113} 114