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"], |
| 46 | generated_headers: ["gen-platform-proto-constants"], |
| 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", |
| 57 | "libincident", |
| 58 | "liblog", |
| 59 | "libprotoutil", |
| 60 | "libservices", |
| 61 | "libutils", |
Mike Ma | 2838169 | 2018-12-04 15:46:29 -0800 | [diff] [blame] | 62 | "libprotobuf-cpp-lite", |
Yao Chen | 43706b4 | 2019-04-21 14:34:30 -0700 | [diff] [blame] | 63 | "libcrypto", |
| 64 | "libkeystore_aidl", |
| 65 | "libkeystore_binder", |
| 66 | "libkeystore_parcelables", |
| 67 | "android.hardware.keymaster@4.0", |
| 68 | "libkeymaster4support", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 69 | ], |
| 70 | |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 71 | static_libs: [ |
| 72 | "libincidentcompanion", |
| 73 | "libplatformprotos", |
| 74 | ], |
| 75 | |
Joe Onorato | fe7bbf4 | 2019-03-24 20:57:16 -0700 | [diff] [blame] | 76 | product_variables: { |
| 77 | debuggable: { |
| 78 | cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"], |
| 79 | }, |
| 80 | }, |
| 81 | |
| 82 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 83 | init_rc: ["incidentd.rc"], |
| 84 | } |
| 85 | |
| 86 | // ============== |
| 87 | // incidentd_test |
| 88 | // ============== |
| 89 | |
| 90 | cc_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 Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 99 | "-g", |
Joe Onorato | e547205 | 2019-04-24 16:27:33 -0700 | [diff] [blame^] | 100 | "-Wno-tautological-undefined-compare", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 101 | |
| 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 Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 111 | "tests/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 112 | "src/FdBuffer.cpp", |
| 113 | "src/Privacy.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 114 | "src/PrivacyFilter.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 115 | "src/Reporter.cpp", |
| 116 | "src/Section.cpp", |
| 117 | "src/Throttler.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 118 | "src/WorkDirectory.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 119 | "src/incidentd_util.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 120 | "src/proto_util.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 121 | "src/report_directory.cpp", |
Yao Chen | 43706b4 | 2019-04-21 14:34:30 -0700 | [diff] [blame] | 122 | "src/cipher/IncidentKeyStore.cpp", |
| 123 | "src/cipher/ProtoEncryption.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 124 | "src/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 125 | ], |
| 126 | |
| 127 | data: ["testdata/**/*"], |
| 128 | |
Yao Chen | ec21648 | 2019-02-06 16:45:40 -0800 | [diff] [blame] | 129 | static_libs: [ |
| 130 | "libgmock", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 131 | "libincidentcompanion", |
| 132 | "libplatformprotos-test", |
Yao Chen | ec21648 | 2019-02-06 16:45:40 -0800 | [diff] [blame] | 133 | ], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 134 | shared_libs: [ |
| 135 | "libbase", |
| 136 | "libbinder", |
| 137 | "libdebuggerd_client", |
| 138 | "libdumputils", |
| 139 | "libincident", |
| 140 | "liblog", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 141 | "libprotobuf-cpp-full", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 142 | "libprotoutil", |
| 143 | "libservices", |
| 144 | "libutils", |
Yao Chen | 43706b4 | 2019-04-21 14:34:30 -0700 | [diff] [blame] | 145 | "libcrypto", |
| 146 | "libkeystore_aidl", |
| 147 | "libkeystore_binder", |
| 148 | "libkeystore_parcelables", |
| 149 | "android.hardware.keymaster@4.0", |
| 150 | "libkeymaster4support", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 151 | ], |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 152 | |
| 153 | target: { |
| 154 | android: { |
| 155 | proto: { |
| 156 | type: "full", |
| 157 | }, |
| 158 | }, |
| 159 | }, |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | genrule { |
| 163 | name: "incidentd_section_list", |
| 164 | tools: ["incident-section-gen"], |
| 165 | out: ["section_list.cpp"], |
| 166 | cmd: "$(location incident-section-gen) incidentd > $(out)", |
| 167 | } |