blob: 1e970f46b01d2a81837e645a37c6057c8c8ffa54 [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",
56 ],
57
58 init_rc: ["incidentd.rc"],
59}
60
61// ==============
62// incidentd_test
63// ==============
64
65cc_test {
66 name: "incidentd_test",
67 test_suites: ["device-tests"],
68
69 cflags: [
70 "-Werror",
71 "-Wall",
72 "-Wno-unused-variable",
73 "-Wunused-parameter",
74
75 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
76 "-Wno-error=implicit-fallthrough",
77 ],
78
79 local_include_dirs: ["src"],
80 generated_headers: ["gen-platform-proto-constants"],
81
82 srcs: [
83 "tests/**/*.cpp",
84 "src/PrivacyBuffer.cpp",
85 "src/FdBuffer.cpp",
86 "src/Privacy.cpp",
87 "src/Reporter.cpp",
88 "src/Section.cpp",
89 "src/Throttler.cpp",
90 "src/incidentd_util.cpp",
91 "src/report_directory.cpp",
92 ],
93
94 data: ["testdata/**/*"],
95
96 static_libs: ["libgmock"],
97
98 shared_libs: [
99 "libbase",
100 "libbinder",
101 "libdebuggerd_client",
102 "libdumputils",
103 "libincident",
104 "liblog",
105 "libprotobuf-cpp-lite",
106 "libprotoutil",
107 "libservices",
108 "libutils",
109 ],
110}
111
112genrule {
113 name: "incidentd_section_list",
114 tools: ["incident-section-gen"],
115 out: ["section_list.cpp"],
116 cmd: "$(location incident-section-gen) incidentd > $(out)",
117}