blob: c08f9b04f0df33b026d425c9f5c150291a49c4e2 [file] [log] [blame]
Yao Chend54f9dd2017-10-17 17:37:48 +00001//
2// Copyright (C) 2017 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// ==========================================================
18// Build the host executable: stats-log-api-gen
19// ==========================================================
20cc_binary_host {
21 name: "stats-log-api-gen",
22 srcs: [
23 "Collation.cpp",
24 "main.cpp",
25 ],
Chih-Hung Hsiehca189f42017-11-10 15:06:53 -080026 cflags: [
27 "-Wall",
28 "-Werror",
29 ],
Yao Chend54f9dd2017-10-17 17:37:48 +000030
31 shared_libs: [
32 "libstats_proto_host",
33 "libprotobuf-cpp-full",
Tej Singh1f431f32019-03-07 19:08:52 -080034 "libbase",
Yao Chend54f9dd2017-10-17 17:37:48 +000035 ],
36
37 proto: {
38 type: "full",
39 },
40}
41
42// ==========================================================
43// Build the host test executable: stats-log-api-gen
44// ==========================================================
45cc_test_host {
46 name: "stats-log-api-gen-test",
47 cflags: [
48 "-Wall",
49 "-Wextra",
50 "-Werror",
51 "-g",
52 "-DUNIT_TEST",
53 ],
54 srcs: [
55 "Collation.cpp",
56 "test_collation.cpp",
57 "test.proto",
58 ],
59
60 static_libs: [
61 "libgmock_host",
62 ],
63
64 shared_libs: [
65 "libstats_proto_host",
Yao Chen9c1debe2018-02-19 14:39:19 -080066 "libprotobuf-cpp-full",
Yao Chend54f9dd2017-10-17 17:37:48 +000067 ],
68
69 proto: {
70 type: "full",
Yao Chen9c1debe2018-02-19 14:39:19 -080071 include_dirs: [
72 "external/protobuf/src",
73 ],
Yao Chend54f9dd2017-10-17 17:37:48 +000074 },
75}
76
77// ==========================================================
78// Native library
79// ==========================================================
80genrule {
81 name: "statslog.h",
82 tools: ["stats-log-api-gen"],
83 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog.h",
84 out: [
85 "statslog.h",
86 ],
87}
88
89genrule {
90 name: "statslog.cpp",
91 tools: ["stats-log-api-gen"],
92 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp",
93 out: [
94 "statslog.cpp",
95 ],
96}
97
Mitch Phillips6bbc91b2019-10-21 13:32:14 -070098cc_library {
Yao Chend54f9dd2017-10-17 17:37:48 +000099 name: "libstatslog",
Jack He34a892d2018-12-20 00:42:31 -0800100 host_supported: true,
Yao Chend54f9dd2017-10-17 17:37:48 +0000101 generated_sources: ["statslog.cpp"],
102 generated_headers: ["statslog.h"],
Yao Chen88e88102018-05-02 09:23:05 -0700103 cflags: [
104 "-Wall",
105 "-Werror",
106 ],
107 export_generated_headers: ["statslog.h"],
108 shared_libs: [
109 "liblog",
Yao Chencf3829a2018-06-05 14:20:35 -0700110 "libcutils",
Yao Chen88e88102018-05-02 09:23:05 -0700111 ],
112 static_libs: ["libstatssocket"],
Jack He34a892d2018-12-20 00:42:31 -0800113 target: {
114 android: {
115 shared_libs: [
116 "libutils",
117 ],
118 },
119 host: {
120 static_libs: [
121 "libutils",
122 ],
123 },
124 },
Yao Chen88e88102018-05-02 09:23:05 -0700125}