Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 1 | // 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 | |
| 19 | cc_binary { |
| 20 | name: "incidentd", |
| 21 | |
| 22 | srcs: [ |
| 23 | "src/**/*.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 24 | "src/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 25 | ":incidentd_section_list", |
| 26 | ], |
| 27 | |
| 28 | cflags: [ |
| 29 | "-Wall", |
| 30 | "-Werror", |
| 31 | "-Wno-missing-field-initializers", |
| 32 | "-Wno-unused-variable", |
| 33 | "-Wunused-parameter", |
Joe Onorato | e547205 | 2019-04-24 16:27:33 -0700 | [diff] [blame] | 34 | "-Wno-tautological-undefined-compare", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 35 | |
| 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"], |
Mike Ma | a47ad72 | 2020-01-28 22:04:20 -0800 | [diff] [blame] | 46 | generated_headers: ["framework-cppstream-protos"], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 47 | |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 48 | proto: { |
| 49 | type: "lite", |
| 50 | }, |
| 51 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 52 | shared_libs: [ |
| 53 | "libbase", |
| 54 | "libbinder", |
| 55 | "libdebuggerd_client", |
| 56 | "libdumputils", |
Joe Onorato | 255ffff | 2020-01-17 01:30:02 -0800 | [diff] [blame] | 57 | "libincidentpriv", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 58 | "liblog", |
| 59 | "libprotoutil", |
| 60 | "libservices", |
| 61 | "libutils", |
Mike Ma | 2838169 | 2018-12-04 15:46:29 -0800 | [diff] [blame] | 62 | "libprotobuf-cpp-lite", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 63 | ], |
| 64 | |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 65 | static_libs: [ |
| 66 | "libincidentcompanion", |
| 67 | "libplatformprotos", |
| 68 | ], |
| 69 | |
Joe Onorato | fe7bbf4 | 2019-03-24 20:57:16 -0700 | [diff] [blame] | 70 | product_variables: { |
| 71 | debuggable: { |
| 72 | cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"], |
| 73 | }, |
| 74 | }, |
| 75 | |
| 76 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 77 | init_rc: ["incidentd.rc"], |
| 78 | } |
| 79 | |
| 80 | // ============== |
| 81 | // incidentd_test |
| 82 | // ============== |
| 83 | |
| 84 | cc_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 Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 93 | "-g", |
Joe Onorato | e547205 | 2019-04-24 16:27:33 -0700 | [diff] [blame] | 94 | "-Wno-tautological-undefined-compare", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 95 | |
| 96 | // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed. |
| 97 | "-Wno-error=implicit-fallthrough", |
| 98 | ], |
| 99 | |
| 100 | local_include_dirs: ["src"], |
Mike Ma | a47ad72 | 2020-01-28 22:04:20 -0800 | [diff] [blame] | 101 | generated_headers: ["framework-cppstream-protos"], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 102 | |
| 103 | srcs: [ |
| 104 | "tests/**/*.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 105 | "tests/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 106 | "src/FdBuffer.cpp", |
| 107 | "src/Privacy.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 108 | "src/PrivacyFilter.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 109 | "src/Reporter.cpp", |
| 110 | "src/Section.cpp", |
| 111 | "src/Throttler.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 112 | "src/WorkDirectory.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 113 | "src/incidentd_util.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 114 | "src/proto_util.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 115 | "src/report_directory.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 116 | "src/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 117 | ], |
| 118 | |
| 119 | data: ["testdata/**/*"], |
| 120 | |
Yao Chen | ec21648 | 2019-02-06 16:45:40 -0800 | [diff] [blame] | 121 | static_libs: [ |
| 122 | "libgmock", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 123 | "libincidentcompanion", |
| 124 | "libplatformprotos-test", |
Yao Chen | ec21648 | 2019-02-06 16:45:40 -0800 | [diff] [blame] | 125 | ], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 126 | shared_libs: [ |
| 127 | "libbase", |
| 128 | "libbinder", |
| 129 | "libdebuggerd_client", |
| 130 | "libdumputils", |
Joe Onorato | 255ffff | 2020-01-17 01:30:02 -0800 | [diff] [blame] | 131 | "libincidentpriv", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 132 | "liblog", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 133 | "libprotobuf-cpp-full", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 134 | "libprotoutil", |
| 135 | "libservices", |
| 136 | "libutils", |
| 137 | ], |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 138 | |
| 139 | target: { |
| 140 | android: { |
| 141 | proto: { |
| 142 | type: "full", |
| 143 | }, |
| 144 | }, |
| 145 | }, |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | genrule { |
| 149 | name: "incidentd_section_list", |
| 150 | tools: ["incident-section-gen"], |
| 151 | out: ["section_list.cpp"], |
| 152 | cmd: "$(location incident-section-gen) incidentd > $(out)", |
| 153 | } |