blob: 534a38f14136449119d346992c09cf2cfe7c07fe [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",
Yao Chen43706b42019-04-21 14:34:30 -070063 "libcrypto",
64 "libkeystore_aidl",
65 "libkeystore_binder",
66 "libkeystore_parcelables",
67 "android.hardware.keymaster@4.0",
68 "libkeymaster4support",
Colin Crossbc2dc312018-10-26 22:34:06 -070069 ],
70
Joe Onorato99598ee2019-02-11 15:55:13 +000071 static_libs: [
72 "libincidentcompanion",
73 "libplatformprotos",
74 ],
75
Joe Onoratofe7bbf42019-03-24 20:57:16 -070076 product_variables: {
77 debuggable: {
78 cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"],
79 },
80 },
81
82
Colin Crossbc2dc312018-10-26 22:34:06 -070083 init_rc: ["incidentd.rc"],
84}
85
86// ==============
87// incidentd_test
88// ==============
89
90cc_test {
91 name: "incidentd_test",
92 test_suites: ["device-tests"],
93
94 cflags: [
95 "-Werror",
96 "-Wall",
97 "-Wno-unused-variable",
98 "-Wunused-parameter",
Joe Onorato99598ee2019-02-11 15:55:13 +000099 "-g",
Joe Onoratoe5472052019-04-24 16:27:33 -0700100 "-Wno-tautological-undefined-compare",
Colin Crossbc2dc312018-10-26 22:34:06 -0700101
102 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
103 "-Wno-error=implicit-fallthrough",
104 ],
105
106 local_include_dirs: ["src"],
107 generated_headers: ["gen-platform-proto-constants"],
108
109 srcs: [
110 "tests/**/*.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000111 "tests/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700112 "src/FdBuffer.cpp",
113 "src/Privacy.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000114 "src/PrivacyFilter.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700115 "src/Reporter.cpp",
116 "src/Section.cpp",
117 "src/Throttler.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000118 "src/WorkDirectory.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700119 "src/incidentd_util.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000120 "src/proto_util.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700121 "src/report_directory.cpp",
Yao Chen43706b42019-04-21 14:34:30 -0700122 "src/cipher/IncidentKeyStore.cpp",
123 "src/cipher/ProtoEncryption.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000124 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700125 ],
126
127 data: ["testdata/**/*"],
128
Yao Chenec216482019-02-06 16:45:40 -0800129 static_libs: [
130 "libgmock",
Joe Onorato99598ee2019-02-11 15:55:13 +0000131 "libincidentcompanion",
132 "libplatformprotos-test",
Yao Chenec216482019-02-06 16:45:40 -0800133 ],
Colin Crossbc2dc312018-10-26 22:34:06 -0700134 shared_libs: [
135 "libbase",
136 "libbinder",
137 "libdebuggerd_client",
138 "libdumputils",
139 "libincident",
140 "liblog",
Joe Onorato99598ee2019-02-11 15:55:13 +0000141 "libprotobuf-cpp-full",
Colin Crossbc2dc312018-10-26 22:34:06 -0700142 "libprotoutil",
143 "libservices",
144 "libutils",
Yao Chen43706b42019-04-21 14:34:30 -0700145 "libcrypto",
146 "libkeystore_aidl",
147 "libkeystore_binder",
148 "libkeystore_parcelables",
149 "android.hardware.keymaster@4.0",
150 "libkeymaster4support",
Colin Crossbc2dc312018-10-26 22:34:06 -0700151 ],
Joe Onorato99598ee2019-02-11 15:55:13 +0000152
153 target: {
154 android: {
155 proto: {
156 type: "full",
157 },
158 },
159 },
Colin Crossbc2dc312018-10-26 22:34:06 -0700160}
161
162genrule {
163 name: "incidentd_section_list",
164 tools: ["incident-section-gen"],
165 out: ["section_list.cpp"],
166 cmd: "$(location incident-section-gen) incidentd > $(out)",
167}