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