blob: 9c9b6c754002779aa632607efa2cd510abf28552 [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",
Yao Chen43706b42019-04-21 14:34:30 -070062 "libcrypto",
63 "libkeystore_aidl",
64 "libkeystore_binder",
65 "libkeystore_parcelables",
66 "android.hardware.keymaster@4.0",
67 "libkeymaster4support",
Colin Crossbc2dc312018-10-26 22:34:06 -070068 ],
69
Joe Onorato99598ee2019-02-11 15:55:13 +000070 static_libs: [
71 "libincidentcompanion",
72 "libplatformprotos",
73 ],
74
Joe Onoratofe7bbf42019-03-24 20:57:16 -070075 product_variables: {
76 debuggable: {
77 cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"],
78 },
79 },
80
81
Colin Crossbc2dc312018-10-26 22:34:06 -070082 init_rc: ["incidentd.rc"],
83}
84
85// ==============
86// incidentd_test
87// ==============
88
89cc_test {
90 name: "incidentd_test",
91 test_suites: ["device-tests"],
92
93 cflags: [
94 "-Werror",
95 "-Wall",
96 "-Wno-unused-variable",
97 "-Wunused-parameter",
Joe Onorato99598ee2019-02-11 15:55:13 +000098 "-g",
Colin Crossbc2dc312018-10-26 22:34:06 -070099
100 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
101 "-Wno-error=implicit-fallthrough",
102 ],
103
104 local_include_dirs: ["src"],
105 generated_headers: ["gen-platform-proto-constants"],
106
107 srcs: [
108 "tests/**/*.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000109 "tests/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700110 "src/FdBuffer.cpp",
111 "src/Privacy.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000112 "src/PrivacyFilter.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700113 "src/Reporter.cpp",
114 "src/Section.cpp",
115 "src/Throttler.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000116 "src/WorkDirectory.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700117 "src/incidentd_util.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000118 "src/proto_util.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700119 "src/report_directory.cpp",
Yao Chen43706b42019-04-21 14:34:30 -0700120 "src/cipher/IncidentKeyStore.cpp",
121 "src/cipher/ProtoEncryption.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000122 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700123 ],
124
125 data: ["testdata/**/*"],
126
Yao Chenec216482019-02-06 16:45:40 -0800127 static_libs: [
128 "libgmock",
Joe Onorato99598ee2019-02-11 15:55:13 +0000129 "libincidentcompanion",
130 "libplatformprotos-test",
Yao Chenec216482019-02-06 16:45:40 -0800131 ],
Colin Crossbc2dc312018-10-26 22:34:06 -0700132 shared_libs: [
133 "libbase",
134 "libbinder",
135 "libdebuggerd_client",
136 "libdumputils",
137 "libincident",
138 "liblog",
Joe Onorato99598ee2019-02-11 15:55:13 +0000139 "libprotobuf-cpp-full",
Colin Crossbc2dc312018-10-26 22:34:06 -0700140 "libprotoutil",
141 "libservices",
142 "libutils",
Yao Chen43706b42019-04-21 14:34:30 -0700143 "libcrypto",
144 "libkeystore_aidl",
145 "libkeystore_binder",
146 "libkeystore_parcelables",
147 "android.hardware.keymaster@4.0",
148 "libkeymaster4support",
Colin Crossbc2dc312018-10-26 22:34:06 -0700149 ],
Joe Onorato99598ee2019-02-11 15:55:13 +0000150
151 target: {
152 android: {
153 proto: {
154 type: "full",
155 },
156 },
157 },
Colin Crossbc2dc312018-10-26 22:34:06 -0700158}
159
160genrule {
161 name: "incidentd_section_list",
162 tools: ["incident-section-gen"],
163 out: ["section_list.cpp"],
164 cmd: "$(location incident-section-gen) incidentd > $(out)",
165}