blob: b0b23f569664fb34ac4e63310264cac89b3c7402 [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
Bob Badoure539dba2021-02-12 17:07:05 -080019package {
20 // See: http://go/android-license-faq
21 // A large-scale-change added 'default_applicable_licenses' to import
22 // all of the 'license_kinds' from "frameworks_base_license"
23 // to get the below license kinds:
24 // SPDX-license-identifier-Apache-2.0
25 default_applicable_licenses: ["frameworks_base_license"],
26}
27
Colin Crossbc2dc312018-10-26 22:34:06 -070028cc_binary {
29 name: "incidentd",
30
31 srcs: [
32 "src/**/*.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +000033 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -070034 ":incidentd_section_list",
35 ],
36
37 cflags: [
38 "-Wall",
39 "-Werror",
40 "-Wno-missing-field-initializers",
41 "-Wno-unused-variable",
42 "-Wunused-parameter",
Joe Onoratoe5472052019-04-24 16:27:33 -070043 "-Wno-tautological-undefined-compare",
Colin Crossbc2dc312018-10-26 22:34:06 -070044
45 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
46 "-Wno-error=implicit-fallthrough",
47
48 // optimize for size (protobuf glop can get big)
49 "-Os",
50 //"-g",
51 //"-O0",
52 ],
53
54 local_include_dirs: ["src"],
Mike Maa47ad722020-01-28 22:04:20 -080055 generated_headers: ["framework-cppstream-protos"],
Colin Crossbc2dc312018-10-26 22:34:06 -070056
Joe Onorato99598ee2019-02-11 15:55:13 +000057 proto: {
58 type: "lite",
59 },
60
Colin Crossbc2dc312018-10-26 22:34:06 -070061 shared_libs: [
62 "libbase",
63 "libbinder",
64 "libdebuggerd_client",
65 "libdumputils",
Joe Onorato255ffff2020-01-17 01:30:02 -080066 "libincidentpriv",
Colin Crossbc2dc312018-10-26 22:34:06 -070067 "liblog",
68 "libprotoutil",
69 "libservices",
70 "libutils",
Mike Ma28381692018-12-04 15:46:29 -080071 "libprotobuf-cpp-lite",
Colin Crossbc2dc312018-10-26 22:34:06 -070072 ],
73
Joe Onorato99598ee2019-02-11 15:55:13 +000074 static_libs: [
75 "libincidentcompanion",
76 "libplatformprotos",
77 ],
78
Joe Onoratofe7bbf42019-03-24 20:57:16 -070079 product_variables: {
80 debuggable: {
81 cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"],
82 },
83 },
84
85
Colin Crossbc2dc312018-10-26 22:34:06 -070086 init_rc: ["incidentd.rc"],
87}
88
89// ==============
90// incidentd_test
91// ==============
92
93cc_test {
94 name: "incidentd_test",
95 test_suites: ["device-tests"],
96
97 cflags: [
98 "-Werror",
99 "-Wall",
100 "-Wno-unused-variable",
101 "-Wunused-parameter",
Joe Onorato99598ee2019-02-11 15:55:13 +0000102 "-g",
Joe Onoratoe5472052019-04-24 16:27:33 -0700103 "-Wno-tautological-undefined-compare",
Colin Crossbc2dc312018-10-26 22:34:06 -0700104
105 // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed.
106 "-Wno-error=implicit-fallthrough",
107 ],
108
109 local_include_dirs: ["src"],
Mike Maa47ad722020-01-28 22:04:20 -0800110 generated_headers: ["framework-cppstream-protos"],
Colin Crossbc2dc312018-10-26 22:34:06 -0700111
112 srcs: [
113 "tests/**/*.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000114 "tests/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700115 "src/FdBuffer.cpp",
116 "src/Privacy.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000117 "src/PrivacyFilter.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700118 "src/Reporter.cpp",
119 "src/Section.cpp",
120 "src/Throttler.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000121 "src/WorkDirectory.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700122 "src/incidentd_util.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000123 "src/proto_util.cpp",
Colin Crossbc2dc312018-10-26 22:34:06 -0700124 "src/report_directory.cpp",
Joe Onorato99598ee2019-02-11 15:55:13 +0000125 "src/**/*.proto",
Colin Crossbc2dc312018-10-26 22:34:06 -0700126 ],
127
128 data: ["testdata/**/*"],
129
Yao Chenec216482019-02-06 16:45:40 -0800130 static_libs: [
131 "libgmock",
Joe Onorato99598ee2019-02-11 15:55:13 +0000132 "libincidentcompanion",
133 "libplatformprotos-test",
Yao Chenec216482019-02-06 16:45:40 -0800134 ],
Colin Crossbc2dc312018-10-26 22:34:06 -0700135 shared_libs: [
136 "libbase",
137 "libbinder",
138 "libdebuggerd_client",
139 "libdumputils",
Joe Onorato255ffff2020-01-17 01:30:02 -0800140 "libincidentpriv",
Colin Crossbc2dc312018-10-26 22:34:06 -0700141 "liblog",
Joe Onorato99598ee2019-02-11 15:55:13 +0000142 "libprotobuf-cpp-full",
Colin Crossbc2dc312018-10-26 22:34:06 -0700143 "libprotoutil",
144 "libservices",
145 "libutils",
146 ],
Joe Onorato99598ee2019-02-11 15:55:13 +0000147
148 target: {
149 android: {
150 proto: {
151 type: "full",
152 },
153 },
154 },
Colin Crossbc2dc312018-10-26 22:34:06 -0700155}
156
157genrule {
158 name: "incidentd_section_list",
159 tools: ["incident-section-gen"],
160 out: ["section_list.cpp"],
161 cmd: "$(location incident-section-gen) incidentd > $(out)",
162}