blob: dc2ed433d345cdb2d0ba5658af53730cbd77e493 [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",
65 ],
66
67 proto: {
68 type: "full",
69 },
70}
71
72// ==========================================================
73// Native library
74// ==========================================================
75genrule {
76 name: "statslog.h",
77 tools: ["stats-log-api-gen"],
78 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog.h",
79 out: [
80 "statslog.h",
81 ],
82}
83
84genrule {
85 name: "statslog.cpp",
86 tools: ["stats-log-api-gen"],
87 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp",
88 out: [
89 "statslog.cpp",
90 ],
91}
92
93cc_library_shared {
94 name: "libstatslog",
95 generated_sources: ["statslog.cpp"],
96 generated_headers: ["statslog.h"],
Chih-Hung Hsiehca189f42017-11-10 15:06:53 -080097 cflags: [
98 "-Wall",
99 "-Werror",
Yangster-mac7604aea2017-12-11 22:55:49 -0800100 "-fexceptions",
Chih-Hung Hsiehca189f42017-11-10 15:06:53 -0800101 ],
Yao Chend54f9dd2017-10-17 17:37:48 +0000102 export_generated_headers: ["statslog.h"],
103 shared_libs: [
104 "liblog",
Yangster-mac330af582018-02-08 15:24:38 -0800105 "libutils",
Yao Chend54f9dd2017-10-17 17:37:48 +0000106 ],
107}
108