Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 1 | // Copyright (C) 2013 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 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 15 | // Default flags to be used throughout all libraries in inputflinger. |
Bob Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame] | 16 | package { |
| 17 | // See: http://go/android-license-faq |
| 18 | // A large-scale-change added 'default_applicable_licenses' to import |
| 19 | // all of the 'license_kinds' from "frameworks_native_license" |
| 20 | // to get the below license kinds: |
| 21 | // SPDX-license-identifier-Apache-2.0 |
| 22 | default_applicable_licenses: ["frameworks_native_license"], |
| 23 | } |
| 24 | |
Michael Wright | 8e9a856 | 2022-02-09 13:44:29 +0000 | [diff] [blame] | 25 | inputflinger_tidy_checks = [ |
| 26 | "android-*", |
| 27 | ] |
| 28 | |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 29 | cc_defaults { |
| 30 | name: "inputflinger_defaults", |
Siarhei Vishniakou | 4c155eb | 2023-06-30 11:47:12 -0700 | [diff] [blame] | 31 | host_supported: true, |
Siarhei Vishniakou | f47c339e | 2021-12-30 11:22:26 -0800 | [diff] [blame] | 32 | cpp_std: "c++20", |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 33 | cflags: [ |
| 34 | "-Wall", |
| 35 | "-Wextra", |
| 36 | "-Werror", |
| 37 | "-Wno-unused-parameter", |
| 38 | "-Wthread-safety", |
Siarhei Vishniakou | b4d960d | 2019-10-03 15:38:44 -0500 | [diff] [blame] | 39 | "-Wshadow", |
Siarhei Vishniakou | 3cab9b6 | 2020-08-05 11:45:47 -0500 | [diff] [blame] | 40 | "-Wshadow-field-in-constructor-modified", |
| 41 | "-Wshadow-uncaptured-local", |
Siarhei Vishniakou | aed7ad0 | 2022-08-03 15:04:33 -0700 | [diff] [blame] | 42 | "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 43 | ], |
Siarhei Vishniakou | d549b25 | 2020-08-11 11:25:26 -0500 | [diff] [blame] | 44 | sanitize: { |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 45 | misc_undefined: [ |
| 46 | "bounds", |
| 47 | ], |
Siarhei Vishniakou | d549b25 | 2020-08-11 11:25:26 -0500 | [diff] [blame] | 48 | }, |
Michael Wright | 8e9a856 | 2022-02-09 13:44:29 +0000 | [diff] [blame] | 49 | tidy: true, |
| 50 | tidy_checks: [ |
| 51 | "-*", // Disable all checks not explicitly enabled for now |
| 52 | ] + inputflinger_tidy_checks, |
| 53 | tidy_checks_as_errors: inputflinger_tidy_checks, |
Siarhei Vishniakou | 4c155eb | 2023-06-30 11:47:12 -0700 | [diff] [blame] | 54 | target: { |
| 55 | host: { |
| 56 | sanitize: { |
| 57 | address: true, |
| 58 | }, |
| 59 | include_dirs: [ |
| 60 | "bionic/libc/kernel/android/uapi/", |
| 61 | "bionic/libc/kernel/uapi", |
| 62 | ], |
| 63 | cflags: [ |
| 64 | "-D__ANDROID_HOST__", |
| 65 | ], |
| 66 | }, |
| 67 | }, |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 68 | } |
| 69 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 70 | ///////////////////////////////////////////////// |
| 71 | // libinputflinger |
| 72 | ///////////////////////////////////////////////// |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 73 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 74 | filegroup { |
| 75 | name: "libinputflinger_sources", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 76 | srcs: [ |
Siarhei Vishniakou | 34d6fef | 2022-02-01 19:03:45 -0800 | [diff] [blame] | 77 | "InputCommonConverter.cpp", |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 78 | "InputDeviceMetricsCollector.cpp", |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 79 | "InputProcessor.cpp", |
Siarhei Vishniakou | a3c8e51 | 2022-02-10 19:46:34 -0800 | [diff] [blame] | 80 | "PreferStylusOverTouchBlocker.cpp", |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 81 | "UnwantedInteractionBlocker.cpp", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 82 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 83 | } |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 84 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 85 | cc_defaults { |
| 86 | name: "libinputflinger_defaults", |
| 87 | srcs: [":libinputflinger_sources"], |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 88 | shared_libs: [ |
Harry Cutts | d1f18fa | 2022-12-08 14:28:02 +0000 | [diff] [blame] | 89 | "android.hardware.input.processor-V1-ndk", |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 90 | "libbase", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 91 | "libbinder", |
Siarhei Vishniakou | 34d6fef | 2022-02-01 19:03:45 -0800 | [diff] [blame] | 92 | "libbinder_ndk", |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 93 | "libchrome", |
Gang Wang | 342c927 | 2020-01-13 13:15:04 -0500 | [diff] [blame] | 94 | "libcrypto", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 95 | "libcutils", |
Siarhei Vishniakou | 473174e | 2017-12-27 16:44:42 -0800 | [diff] [blame] | 96 | "libhidlbase", |
Prabir Pradhan | 89f7119 | 2023-06-15 22:14:15 +0000 | [diff] [blame] | 97 | "libinput", |
Siarhei Vishniakou | 99b9d38 | 2021-04-01 08:03:41 +0000 | [diff] [blame] | 98 | "libkll", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 99 | "liblog", |
Siarhei Vishniakou | 99b9d38 | 2021-04-01 08:03:41 +0000 | [diff] [blame] | 100 | "libprotobuf-cpp-lite", |
Siarhei Vishniakou | de4bf15 | 2019-08-16 11:12:52 -0500 | [diff] [blame] | 101 | "libstatslog", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 102 | "libutils", |
Siarhei Vishniakou | a04181f | 2021-03-26 05:56:49 +0000 | [diff] [blame] | 103 | "server_configurable_flags", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 104 | ], |
chaviw | 09c8d2d | 2020-08-24 15:48:26 -0700 | [diff] [blame] | 105 | static_libs: [ |
| 106 | "libattestation", |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 107 | "libpalmrejection", |
Siarhei Vishniakou | 862ae21 | 2022-09-28 15:17:28 -0700 | [diff] [blame] | 108 | "libui-types", |
chaviw | 09c8d2d | 2020-08-24 15:48:26 -0700 | [diff] [blame] | 109 | ], |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 110 | target: { |
| 111 | android: { |
| 112 | shared_libs: [ |
| 113 | "libgui", |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 114 | "libstatspull", |
| 115 | "libstatssocket", |
| 116 | ], |
| 117 | }, |
| 118 | host: { |
| 119 | static_libs: [ |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 120 | "libstatspull", |
| 121 | "libstatssocket", |
| 122 | ], |
| 123 | }, |
| 124 | }, |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 125 | } |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 126 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 127 | cc_library_shared { |
| 128 | name: "libinputflinger", |
Siarhei Vishniakou | cac8427 | 2023-06-28 14:43:25 -0700 | [diff] [blame] | 129 | host_supported: true, |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 130 | defaults: [ |
| 131 | "inputflinger_defaults", |
| 132 | "libinputflinger_defaults", |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 133 | ], |
Siarhei Vishniakou | 45b703e | 2022-11-18 15:33:27 -0800 | [diff] [blame] | 134 | srcs: [ |
| 135 | "InputManager.cpp", |
| 136 | // other sources are added via "defaults" |
| 137 | ], |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 138 | cflags: [ |
Siarhei Vishniakou | 473174e | 2017-12-27 16:44:42 -0800 | [diff] [blame] | 139 | // TODO(b/23084678): Move inputflinger to its own process and mark it hidden |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 140 | //-fvisibility=hidden |
| 141 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 142 | shared_libs: [ |
| 143 | // This should consist only of dependencies from inputflinger. Other dependencies should be |
| 144 | // in cc_defaults so that they are included in the tests. |
| 145 | "libinputflinger_base", |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 146 | "libinputreader", |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 147 | "libinputreporter", |
Prabir Pradhan | addf8e9 | 2023-04-06 00:28:48 +0000 | [diff] [blame] | 148 | "libPlatformProperties", |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 149 | ], |
| 150 | static_libs: [ |
| 151 | "libinputdispatcher", |
| 152 | ], |
| 153 | export_static_lib_headers: [ |
| 154 | "libinputdispatcher", |
| 155 | ], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 156 | export_include_dirs: [ |
| 157 | ".", |
| 158 | "include", |
| 159 | ], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 160 | } |
| 161 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 162 | ///////////////////////////////////////////////// |
| 163 | // libinputflinger_base |
| 164 | ///////////////////////////////////////////////// |
| 165 | |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 166 | cc_library_headers { |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 167 | name: "libinputflinger_headers", |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 168 | host_supported: true, |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 169 | export_include_dirs: ["include"], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 170 | } |
| 171 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 172 | filegroup { |
| 173 | name: "libinputflinger_base_sources", |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 174 | srcs: [ |
| 175 | "InputListener.cpp", |
| 176 | "InputReaderBase.cpp", |
Prabir Pradhan | 5a57cff | 2019-10-31 18:40:33 -0700 | [diff] [blame] | 177 | "InputThread.cpp", |
Siarhei Vishniakou | 7851303 | 2022-09-15 18:42:05 -0700 | [diff] [blame] | 178 | "NotifyArgs.cpp", |
Prabir Pradhan | 8b89c2f | 2021-07-29 16:30:14 +0000 | [diff] [blame] | 179 | "VibrationElement.cpp", |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 180 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 181 | } |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 182 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 183 | cc_defaults { |
| 184 | name: "libinputflinger_base_defaults", |
| 185 | srcs: [":libinputflinger_base_sources"], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 186 | shared_libs: [ |
| 187 | "libbase", |
Zim | 23457d0 | 2022-08-17 12:57:41 +0100 | [diff] [blame] | 188 | "libbinder", |
Garfield Tan | ff1f1bb | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 189 | "libcutils", |
Prabir Pradhan | 89f7119 | 2023-06-15 22:14:15 +0000 | [diff] [blame] | 190 | "libinput", |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 191 | "liblog", |
| 192 | "libutils", |
| 193 | ], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 194 | header_libs: [ |
| 195 | "libinputflinger_headers", |
| 196 | ], |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 197 | } |
| 198 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 199 | cc_library_shared { |
| 200 | name: "libinputflinger_base", |
Siarhei Vishniakou | 3197718 | 2022-09-30 08:51:23 -0700 | [diff] [blame] | 201 | host_supported: true, |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 202 | defaults: [ |
| 203 | "inputflinger_defaults", |
| 204 | "libinputflinger_base_defaults", |
| 205 | ], |
| 206 | export_header_lib_headers: [ |
| 207 | "libinputflinger_headers", |
| 208 | ], |
| 209 | } |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 210 | |
| 211 | // This target will build everything 'input-related'. This could be useful for |
| 212 | // large refactorings of the input code. This is similar to 'm checkbuild', but |
| 213 | // just for input code. |
| 214 | // Use 'm checkinput' to build, and then (optionally) use 'm installclean' to |
| 215 | // remove any of the installed artifacts that you may not want on your actual |
| 216 | // build. |
| 217 | phony { |
| 218 | name: "checkinput", |
| 219 | required: [ |
| 220 | // native targets |
Siarhei Vishniakou | 63b6361 | 2023-04-12 11:00:23 -0700 | [diff] [blame] | 221 | "libgui_test", |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 222 | "libinput", |
Siarhei Vishniakou | 4c155eb | 2023-06-30 11:47:12 -0700 | [diff] [blame] | 223 | "libinputreader_static", |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 224 | "libinputflinger", |
| 225 | "inputflinger_tests", |
| 226 | "inputflinger_benchmarks", |
| 227 | "libinput_tests", |
| 228 | "libpalmrejection_test", |
| 229 | "libandroid_runtime", |
| 230 | "libinputservice_test", |
| 231 | "Bug-115739809", |
| 232 | "StructLayout_test", |
Siarhei Vishniakou | 2a916c4 | 2023-04-17 10:37:05 -0700 | [diff] [blame] | 233 | // currently unused, but still must build correctly |
| 234 | "inputflinger", |
| 235 | "libinputflingerhost", |
Siarhei Vishniakou | 007713d | 2022-09-16 14:40:11 -0700 | [diff] [blame] | 236 | |
Siarhei Vishniakou | 5c02a71 | 2023-05-15 15:45:02 -0700 | [diff] [blame] | 237 | // rust targets |
| 238 | "libinput_rust_test", |
| 239 | |
Siarhei Vishniakou | 007713d | 2022-09-16 14:40:11 -0700 | [diff] [blame] | 240 | // native fuzzers |
Siarhei Vishniakou | 400294a | 2022-08-03 17:58:57 -0700 | [diff] [blame] | 241 | "inputflinger_latencytracker_fuzzer", |
Siarhei Vishniakou | 007713d | 2022-09-16 14:40:11 -0700 | [diff] [blame] | 242 | "inputflinger_cursor_input_fuzzer", |
| 243 | "inputflinger_keyboard_input_fuzzer", |
| 244 | "inputflinger_multitouch_input_fuzzer", |
| 245 | "inputflinger_switch_input_fuzzer", |
Harry Cutts | ccb75e8 | 2023-06-23 14:08:06 +0000 | [diff] [blame] | 246 | "inputflinger_touchpad_input_fuzzer", |
Siarhei Vishniakou | 007713d | 2022-09-16 14:40:11 -0700 | [diff] [blame] | 247 | "inputflinger_input_reader_fuzzer", |
| 248 | "inputflinger_blocking_queue_fuzzer", |
| 249 | "inputflinger_input_classifier_fuzzer", |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 250 | |
| 251 | // Java/Kotlin targets |
Nataniel Borges | 45f243d | 2023-07-25 14:50:20 +0000 | [diff] [blame^] | 252 | "CtsWindowManagerDeviceWindow", |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 253 | "InputTests", |
| 254 | "CtsHardwareTestCases", |
| 255 | "CtsInputTestCases", |
| 256 | "CtsViewTestCases", |
| 257 | "CtsWidgetTestCases", |
| 258 | "FrameworksCoreTests", |
| 259 | "FrameworksServicesTests", |
| 260 | "CtsSecurityTestCases", |
| 261 | "CtsSecurityBulletinHostTestCases", |
| 262 | ], |
| 263 | } |