blob: 004f8b9bfb546ac5d87b365d65119d056b5d945c [file] [log] [blame]
Vova Sharaienko3aaf79b2023-01-13 20:51:30 +00001
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
Vova Sharaienko75f86002023-02-09 01:51:07 +000021cc_defaults {
22 name: "expresslog_defaults",
Vova Sharaienko3aaf79b2023-01-13 20:51:30 +000023 srcs: [
24 "Counter.cpp",
Vova Sharaienko75f86002023-02-09 01:51:07 +000025 "Histogram.cpp",
Vova Sharaienko3aaf79b2023-01-13 20:51:30 +000026 ],
Vova Sharaienko75f86002023-02-09 01:51:07 +000027}
28
29cc_library {
30 name: "libexpresslog",
31 defaults: ["expresslog_defaults"],
Vova Sharaienko3aaf79b2023-01-13 20:51:30 +000032 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",
Vova Sharaienko75f86002023-02-09 01:51:07 +000046 "liblog",
Vova Sharaienko3aaf79b2023-01-13 20:51:30 +000047 "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}
Vova Sharaienko75f86002023-02-09 01:51:07 +000079
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}