blob: 3dc10939fed75c1801c1ea6a2ab4f3c076c4cf11 [file] [log] [blame]
Colin Crossbc2dc312018-10-26 22:34:06 -07001// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// =========
16// incidentd
17// =========
18
19cc_binary {
20 name: "incidentd",
21
22 srcs: [
23 "src/**/*.cpp",
24 ":incidentd_section_list",
25 ],
26
27 cflags: [
28 "-Wall",
29 "-Werror",
30 "-Wno-missing-field-initializers",
31 "-Wno-unused-variable",
32 "-Wunused-parameter",
33
34 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
35 "-Wno-error=implicit-fallthrough",
36
37 // optimize for size (protobuf glop can get big)
38 "-Os",
39 //"-g",
40 //"-O0",
41 ],
42
43 local_include_dirs: ["src"],
44 generated_headers: ["gen-platform-proto-constants"],
45
46 shared_libs: [
47 "libbase",
48 "libbinder",
49 "libdebuggerd_client",
50 "libdumputils",
51 "libincident",
52 "liblog",
53 "libprotoutil",
54 "libservices",
55 "libutils",
Mike Ma28381692018-12-04 15:46:29 -080056 "libprotobuf-cpp-lite",
Colin Crossbc2dc312018-10-26 22:34:06 -070057 ],
58
59 init_rc: ["incidentd.rc"],
60}
61
62// ==============
63// incidentd_test
64// ==============
65
66cc_test {
67 name: "incidentd_test",
68 test_suites: ["device-tests"],
69
70 cflags: [
71 "-Werror",
72 "-Wall",
73 "-Wno-unused-variable",
74 "-Wunused-parameter",
75
76 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
77 "-Wno-error=implicit-fallthrough",
78 ],
79
80 local_include_dirs: ["src"],
81 generated_headers: ["gen-platform-proto-constants"],
82
83 srcs: [
84 "tests/**/*.cpp",
85 "src/PrivacyBuffer.cpp",
86 "src/FdBuffer.cpp",
87 "src/Privacy.cpp",
88 "src/Reporter.cpp",
89 "src/Section.cpp",
90 "src/Throttler.cpp",
91 "src/incidentd_util.cpp",
92 "src/report_directory.cpp",
93 ],
94
95 data: ["testdata/**/*"],
96
Yao Chenec216482019-02-06 16:45:40 -080097 static_libs: [
98 "libgmock",
99 "libplatformprotos",
100 ],
Colin Crossbc2dc312018-10-26 22:34:06 -0700101 shared_libs: [
102 "libbase",
103 "libbinder",
104 "libdebuggerd_client",
105 "libdumputils",
106 "libincident",
107 "liblog",
108 "libprotobuf-cpp-lite",
109 "libprotoutil",
110 "libservices",
111 "libutils",
112 ],
113}
114
115genrule {
116 name: "incidentd_section_list",
117 tools: ["incident-section-gen"],
118 out: ["section_list.cpp"],
119 cmd: "$(location incident-section-gen) incidentd > $(out)",
120}