blob: 8ac11df5e5ad0bcbc524a76365f9175ca8d501f5 [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",
34
35 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
36 "-Wno-error=implicit-fallthrough",
37
38 // optimize for size (protobuf glop can get big)
39 "-Os",
40 //"-g",
41 //"-O0",
42 ],
43
44 local_include_dirs: ["src"],
45 generated_headers: ["gen-platform-proto-constants"],
46
Joe Onorato99598ee2019-02-11 15:55:13 +000047 proto: {
48 type: "lite",
49 },
50
Colin Crossbc2dc312018-10-26 22:34:06 -070051 shared_libs: [
52 "libbase",
53 "libbinder",
54 "libdebuggerd_client",
55 "libdumputils",
56 "libincident",
57 "liblog",
58 "libprotoutil",
59 "libservices",
60 "libutils",
Mike Ma28381692018-12-04 15:46:29 -080061 "libprotobuf-cpp-lite",
Colin Crossbc2dc312018-10-26 22:34:06 -070062 ],
63
Joe Onorato99598ee2019-02-11 15:55:13 +000064 static_libs: [
65 "libincidentcompanion",
66 "libplatformprotos",
67 ],
68
Colin Crossbc2dc312018-10-26 22:34:06 -070069 init_rc: ["incidentd.rc"],
70}
71
72// ==============
73// incidentd_test
74// ==============
75
76cc_test {
77 name: "incidentd_test",
78 test_suites: ["device-tests"],
79
80 cflags: [
81 "-Werror",
82 "-Wall",
83 "-Wno-unused-variable",
84 "-Wunused-parameter",
Joe Onorato99598ee2019-02-11 15:55:13 +000085 "-g",
Colin Crossbc2dc312018-10-26 22:34:06 -070086
87 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
88 "-Wno-error=implicit-fallthrough",
89 ],
90
91 local_include_dirs: ["src"],
92 generated_headers: ["gen-platform-proto-constants"],
93
94 srcs: [
95 "tests/**/*.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +000096 "tests/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -070097 "src/FdBuffer.cpp",
98 "src/Privacy.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +000099 "src/PrivacyFilter.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700100 "src/Reporter.cpp",
101 "src/Section.cpp",
102 "src/Throttler.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000103 "src/WorkDirectory.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700104 "src/incidentd_util.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000105 "src/proto_util.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700106 "src/report_directory.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000107 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700108 ],
109
110 data: ["testdata/**/*"],
111
Yao Chenec216482019-02-06 16:45:40 -0800112 static_libs: [
113 "libgmock",
Joe Onorato99598ee2019-02-11 15:55:13 +0000114 "libincidentcompanion",
115 "libplatformprotos-test",
Yao Chenec216482019-02-06 16:45:40 -0800116 ],
Colin Crossbc2dc312018-10-26 22:34:06 -0700117 shared_libs: [
118 "libbase",
119 "libbinder",
120 "libdebuggerd_client",
121 "libdumputils",
122 "libincident",
123 "liblog",
Joe Onorato99598ee2019-02-11 15:55:13 +0000124 "libprotobuf-cpp-full",
Colin Crossbc2dc312018-10-26 22:34:06 -0700125 "libprotoutil",
126 "libservices",
127 "libutils",
128 ],
Joe Onorato99598ee2019-02-11 15:55:13 +0000129
130 target: {
131 android: {
132 proto: {
133 type: "full",
134 },
135 },
136 },
Colin Crossbc2dc312018-10-26 22:34:06 -0700137}
138
139genrule {
140 name: "incidentd_section_list",
141 tools: ["incident-section-gen"],
142 out: ["section_list.cpp"],
143 cmd: "$(location incident-section-gen) incidentd > $(out)",
144}