blob: 25e0328b4f38e6297e73ccdba090e63fc93e0569 [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",
Joe Onorato99598ee2019-02-11 15:55:13 +000024 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -070025 ":incidentd_section_list",
26 ],
27
28 cflags: [
29 "-Wall",
30 "-Werror",
31 "-Wno-missing-field-initializers",
32 "-Wno-unused-variable",
33 "-Wunused-parameter",
Joe Onoratoe5472052019-04-24 16:27:33 -070034 "-Wno-tautological-undefined-compare",
Colin Crossbc2dc312018-10-26 22:34:06 -070035
36 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
37 "-Wno-error=implicit-fallthrough",
38
39 // optimize for size (protobuf glop can get big)
40 "-Os",
41 //"-g",
42 //"-O0",
43 ],
44
45 local_include_dirs: ["src"],
46 generated_headers: ["gen-platform-proto-constants"],
47
Joe Onorato99598ee2019-02-11 15:55:13 +000048 proto: {
49 type: "lite",
50 },
51
Colin Crossbc2dc312018-10-26 22:34:06 -070052 shared_libs: [
53 "libbase",
54 "libbinder",
55 "libdebuggerd_client",
56 "libdumputils",
57 "libincident",
58 "liblog",
59 "libprotoutil",
60 "libservices",
61 "libutils",
Mike Ma28381692018-12-04 15:46:29 -080062 "libprotobuf-cpp-lite",
Colin Crossbc2dc312018-10-26 22:34:06 -070063 ],
64
Joe Onorato99598ee2019-02-11 15:55:13 +000065 static_libs: [
66 "libincidentcompanion",
67 "libplatformprotos",
68 ],
69
Joe Onoratofe7bbf42019-03-24 20:57:16 -070070 product_variables: {
71 debuggable: {
72 cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"],
73 },
74 },
75
76
Colin Crossbc2dc312018-10-26 22:34:06 -070077 init_rc: ["incidentd.rc"],
78}
79
80// ==============
81// incidentd_test
82// ==============
83
84cc_test {
85 name: "incidentd_test",
86 test_suites: ["device-tests"],
87
88 cflags: [
89 "-Werror",
90 "-Wall",
91 "-Wno-unused-variable",
92 "-Wunused-parameter",
Joe Onorato99598ee2019-02-11 15:55:13 +000093 "-g",
Joe Onoratoe5472052019-04-24 16:27:33 -070094 "-Wno-tautological-undefined-compare",
Colin Crossbc2dc312018-10-26 22:34:06 -070095
96 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
97 "-Wno-error=implicit-fallthrough",
98 ],
99
100 local_include_dirs: ["src"],
101 generated_headers: ["gen-platform-proto-constants"],
102
103 srcs: [
104 "tests/**/*.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000105 "tests/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700106 "src/FdBuffer.cpp",
107 "src/Privacy.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000108 "src/PrivacyFilter.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700109 "src/Reporter.cpp",
110 "src/Section.cpp",
111 "src/Throttler.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000112 "src/WorkDirectory.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700113 "src/incidentd_util.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000114 "src/proto_util.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700115 "src/report_directory.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000116 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700117 ],
118
119 data: ["testdata/**/*"],
120
Yao Chenec216482019-02-06 16:45:40 -0800121 static_libs: [
122 "libgmock",
Joe Onorato99598ee2019-02-11 15:55:13 +0000123 "libincidentcompanion",
124 "libplatformprotos-test",
Yao Chenec216482019-02-06 16:45:40 -0800125 ],
Colin Crossbc2dc312018-10-26 22:34:06 -0700126 shared_libs: [
127 "libbase",
128 "libbinder",
129 "libdebuggerd_client",
130 "libdumputils",
131 "libincident",
132 "liblog",
Joe Onorato99598ee2019-02-11 15:55:13 +0000133 "libprotobuf-cpp-full",
Colin Crossbc2dc312018-10-26 22:34:06 -0700134 "libprotoutil",
135 "libservices",
136 "libutils",
137 ],
Joe Onorato99598ee2019-02-11 15:55:13 +0000138
139 target: {
140 android: {
141 proto: {
142 type: "full",
143 },
144 },
145 },
Colin Crossbc2dc312018-10-26 22:34:06 -0700146}
147
148genrule {
149 name: "incidentd_section_list",
150 tools: ["incident-section-gen"],
151 out: ["section_list.cpp"],
152 cmd: "$(location incident-section-gen) incidentd > $(out)",
153}