blob: 703a67b791be40201438200c1022da94c951933b [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",
34 ],
35
36 proto: {
37 type: "full",
38 },
39}
40
41// ==========================================================
42// Build the host test executable: stats-log-api-gen
43// ==========================================================
44cc_test_host {
45 name: "stats-log-api-gen-test",
46 cflags: [
47 "-Wall",
48 "-Wextra",
49 "-Werror",
50 "-g",
51 "-DUNIT_TEST",
52 ],
53 srcs: [
54 "Collation.cpp",
55 "test_collation.cpp",
56 "test.proto",
57 ],
58
59 static_libs: [
60 "libgmock_host",
61 ],
62
63 shared_libs: [
64 "libstats_proto_host",
Yao Chen9c1debe2018-02-19 14:39:19 -080065 "libprotobuf-cpp-full",
Yao Chend54f9dd2017-10-17 17:37:48 +000066 ],
67
68 proto: {
69 type: "full",
Yao Chen9c1debe2018-02-19 14:39:19 -080070 include_dirs: [
71 "external/protobuf/src",
72 ],
Yao Chend54f9dd2017-10-17 17:37:48 +000073 },
74}
75
76// ==========================================================
77// Native library
78// ==========================================================
79genrule {
80 name: "statslog.h",
81 tools: ["stats-log-api-gen"],
82 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog.h",
83 out: [
84 "statslog.h",
85 ],
86}
87
88genrule {
89 name: "statslog.cpp",
90 tools: ["stats-log-api-gen"],
91 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp",
92 out: [
93 "statslog.cpp",
94 ],
95}
96
97cc_library_shared {
98 name: "libstatslog",
99 generated_sources: ["statslog.cpp"],
100 generated_headers: ["statslog.h"],
Yao Chen88e88102018-05-02 09:23:05 -0700101 cflags: [
102 "-Wall",
103 "-Werror",
104 ],
105 export_generated_headers: ["statslog.h"],
106 shared_libs: [
107 "liblog",
108 "libutils",
Yao Chencf3829a2018-06-05 14:20:35 -0700109 "libcutils",
Yao Chen88e88102018-05-02 09:23:05 -0700110 ],
111 static_libs: ["libstatssocket"],
112}