blob: e3b6db08c503f0824ffa941bff5a32df5d82c438 [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",
Muhammad Qureshi9effe482019-10-29 15:36:44 -070024 "java_writer.cpp",
25 "java_writer_q.cpp",
Yao Chend54f9dd2017-10-17 17:37:48 +000026 "main.cpp",
Muhammad Qureshi4fdc7fd2019-11-24 22:14:38 -080027 "native_writer.cpp",
Muhammad Qureshi9effe482019-10-29 15:36:44 -070028 "utils.cpp",
Yao Chend54f9dd2017-10-17 17:37:48 +000029 ],
Chih-Hung Hsiehca189f42017-11-10 15:06:53 -080030 cflags: [
31 "-Wall",
32 "-Werror",
33 ],
Yao Chend54f9dd2017-10-17 17:37:48 +000034
35 shared_libs: [
36 "libstats_proto_host",
37 "libprotobuf-cpp-full",
Tej Singh1f431f32019-03-07 19:08:52 -080038 "libbase",
Yao Chend54f9dd2017-10-17 17:37:48 +000039 ],
40
41 proto: {
42 type: "full",
43 },
44}
45
46// ==========================================================
47// Build the host test executable: stats-log-api-gen
48// ==========================================================
49cc_test_host {
50 name: "stats-log-api-gen-test",
51 cflags: [
52 "-Wall",
53 "-Wextra",
54 "-Werror",
55 "-g",
56 "-DUNIT_TEST",
57 ],
58 srcs: [
59 "Collation.cpp",
60 "test_collation.cpp",
61 "test.proto",
62 ],
63
64 static_libs: [
65 "libgmock_host",
66 ],
67
68 shared_libs: [
69 "libstats_proto_host",
Yao Chen9c1debe2018-02-19 14:39:19 -080070 "libprotobuf-cpp-full",
Yao Chend54f9dd2017-10-17 17:37:48 +000071 ],
72
73 proto: {
74 type: "full",
Yao Chen9c1debe2018-02-19 14:39:19 -080075 include_dirs: [
76 "external/protobuf/src",
77 ],
Yao Chend54f9dd2017-10-17 17:37:48 +000078 },
79}
80
81// ==========================================================
82// Native library
83// ==========================================================
84genrule {
85 name: "statslog.h",
86 tools: ["stats-log-api-gen"],
87 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog.h",
88 out: [
89 "statslog.h",
90 ],
91}
92
93genrule {
94 name: "statslog.cpp",
95 tools: ["stats-log-api-gen"],
96 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp",
97 out: [
98 "statslog.cpp",
99 ],
100}
101
Mitch Phillips6bbc91b2019-10-21 13:32:14 -0700102cc_library {
Yao Chend54f9dd2017-10-17 17:37:48 +0000103 name: "libstatslog",
Jack He34a892d2018-12-20 00:42:31 -0800104 host_supported: true,
Muhammad Qureshic8e22662019-11-20 17:18:03 -0800105 generated_sources: [
106 "statslog.cpp",
107 ],
108 generated_headers: [
109 "statslog.h"
110 ],
Yao Chen88e88102018-05-02 09:23:05 -0700111 cflags: [
112 "-Wall",
113 "-Werror",
114 ],
Muhammad Qureshic8e22662019-11-20 17:18:03 -0800115 export_generated_headers: [
116 "statslog.h"
117 ],
Yao Chen88e88102018-05-02 09:23:05 -0700118 shared_libs: [
119 "liblog",
Yao Chencf3829a2018-06-05 14:20:35 -0700120 "libcutils",
Yao Chen88e88102018-05-02 09:23:05 -0700121 ],
Tej Singheb7d8f42020-01-29 15:59:35 -0800122 target: {
123 android: {
124 shared_libs: ["libstatssocket"],
125 },
126 host: {
127 static_libs: ["libstatssocket"],
128 },
129 },
Yao Chen88e88102018-05-02 09:23:05 -0700130}
Muhammad Qureshic8e22662019-11-20 17:18:03 -0800131