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 | f47c339e | 2021-12-30 11:22:26 -0800 | [diff] [blame] | 31 | cpp_std: "c++20", |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 32 | cflags: [ |
| 33 | "-Wall", |
| 34 | "-Wextra", |
| 35 | "-Werror", |
| 36 | "-Wno-unused-parameter", |
| 37 | "-Wthread-safety", |
Siarhei Vishniakou | b4d960d | 2019-10-03 15:38:44 -0500 | [diff] [blame] | 38 | "-Wshadow", |
Siarhei Vishniakou | 3cab9b6 | 2020-08-05 11:45:47 -0500 | [diff] [blame] | 39 | "-Wshadow-field-in-constructor-modified", |
| 40 | "-Wshadow-uncaptured-local", |
Siarhei Vishniakou | aed7ad0 | 2022-08-03 15:04:33 -0700 | [diff] [blame] | 41 | "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 42 | ], |
Siarhei Vishniakou | d549b25 | 2020-08-11 11:25:26 -0500 | [diff] [blame] | 43 | sanitize: { |
| 44 | misc_undefined: ["bounds"], |
| 45 | }, |
Michael Wright | 8e9a856 | 2022-02-09 13:44:29 +0000 | [diff] [blame] | 46 | tidy: true, |
| 47 | tidy_checks: [ |
| 48 | "-*", // Disable all checks not explicitly enabled for now |
| 49 | ] + inputflinger_tidy_checks, |
| 50 | tidy_checks_as_errors: inputflinger_tidy_checks, |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 51 | } |
| 52 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 53 | ///////////////////////////////////////////////// |
| 54 | // libinputflinger |
| 55 | ///////////////////////////////////////////////// |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 56 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 57 | filegroup { |
| 58 | name: "libinputflinger_sources", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 59 | srcs: [ |
Siarhei Vishniakou | 9899603 | 2022-08-03 11:54:47 -0700 | [diff] [blame] | 60 | "InputProcessor.cpp", |
Siarhei Vishniakou | 34d6fef | 2022-02-01 19:03:45 -0800 | [diff] [blame] | 61 | "InputCommonConverter.cpp", |
Siarhei Vishniakou | a3c8e51 | 2022-02-10 19:46:34 -0800 | [diff] [blame] | 62 | "PreferStylusOverTouchBlocker.cpp", |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 63 | "UnwantedInteractionBlocker.cpp", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 64 | "InputManager.cpp", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 65 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 66 | } |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 67 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 68 | cc_defaults { |
| 69 | name: "libinputflinger_defaults", |
| 70 | srcs: [":libinputflinger_sources"], |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 71 | shared_libs: [ |
Siarhei Vishniakou | 34d6fef | 2022-02-01 19:03:45 -0800 | [diff] [blame] | 72 | "android.hardware.input.processor-V1-ndk", |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 73 | "libbase", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 74 | "libbinder", |
Siarhei Vishniakou | 34d6fef | 2022-02-01 19:03:45 -0800 | [diff] [blame] | 75 | "libbinder_ndk", |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 76 | "libchrome", |
Gang Wang | 342c927 | 2020-01-13 13:15:04 -0500 | [diff] [blame] | 77 | "libcrypto", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 78 | "libcutils", |
Siarhei Vishniakou | 473174e | 2017-12-27 16:44:42 -0800 | [diff] [blame] | 79 | "libhidlbase", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 80 | "libinput", |
Siarhei Vishniakou | 99b9d38 | 2021-04-01 08:03:41 +0000 | [diff] [blame] | 81 | "libkll", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 82 | "liblog", |
Siarhei Vishniakou | 99b9d38 | 2021-04-01 08:03:41 +0000 | [diff] [blame] | 83 | "libprotobuf-cpp-lite", |
Siarhei Vishniakou | de4bf15 | 2019-08-16 11:12:52 -0500 | [diff] [blame] | 84 | "libstatslog", |
Siarhei Vishniakou | a04181f | 2021-03-26 05:56:49 +0000 | [diff] [blame] | 85 | "libstatspull", |
| 86 | "libstatssocket", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 87 | "libutils", |
Siarhei Vishniakou | a04181f | 2021-03-26 05:56:49 +0000 | [diff] [blame] | 88 | "server_configurable_flags", |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 89 | ], |
chaviw | 09c8d2d | 2020-08-24 15:48:26 -0700 | [diff] [blame] | 90 | static_libs: [ |
| 91 | "libattestation", |
Siarhei Vishniakou | ba0a875 | 2021-09-14 14:43:25 -0700 | [diff] [blame] | 92 | "libpalmrejection", |
Siarhei Vishniakou | 862ae21 | 2022-09-28 15:17:28 -0700 | [diff] [blame] | 93 | "libui-types", |
chaviw | 09c8d2d | 2020-08-24 15:48:26 -0700 | [diff] [blame] | 94 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 95 | } |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 96 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 97 | cc_library_shared { |
| 98 | name: "libinputflinger", |
| 99 | defaults: [ |
| 100 | "inputflinger_defaults", |
| 101 | "libinputflinger_defaults", |
Garfield Tan | e84e6f9 | 2019-08-29 17:28:41 -0700 | [diff] [blame] | 102 | ], |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 103 | cflags: [ |
Siarhei Vishniakou | 473174e | 2017-12-27 16:44:42 -0800 | [diff] [blame] | 104 | // 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] | 105 | //-fvisibility=hidden |
| 106 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 107 | shared_libs: [ |
| 108 | // This should consist only of dependencies from inputflinger. Other dependencies should be |
| 109 | // in cc_defaults so that they are included in the tests. |
| 110 | "libinputflinger_base", |
| 111 | "libinputreporter", |
| 112 | "libinputreader", |
chaviw | 15fab6f | 2021-06-07 14:15:52 -0500 | [diff] [blame] | 113 | "libgui", |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 114 | ], |
| 115 | static_libs: [ |
| 116 | "libinputdispatcher", |
| 117 | ], |
| 118 | export_static_lib_headers: [ |
| 119 | "libinputdispatcher", |
| 120 | ], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 121 | export_include_dirs: [ |
| 122 | ".", |
| 123 | "include", |
| 124 | ], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 125 | } |
| 126 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 127 | ///////////////////////////////////////////////// |
| 128 | // libinputflinger_base |
| 129 | ///////////////////////////////////////////////// |
| 130 | |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 131 | cc_library_headers { |
Siarhei Vishniakou | 61291d4 | 2019-02-11 18:13:20 -0800 | [diff] [blame] | 132 | name: "libinputflinger_headers", |
| 133 | export_include_dirs: ["include"], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 134 | } |
| 135 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 136 | filegroup { |
| 137 | name: "libinputflinger_base_sources", |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 138 | srcs: [ |
| 139 | "InputListener.cpp", |
| 140 | "InputReaderBase.cpp", |
Prabir Pradhan | 5a57cff | 2019-10-31 18:40:33 -0700 | [diff] [blame] | 141 | "InputThread.cpp", |
Siarhei Vishniakou | 7851303 | 2022-09-15 18:42:05 -0700 | [diff] [blame] | 142 | "NotifyArgs.cpp", |
Prabir Pradhan | 8b89c2f | 2021-07-29 16:30:14 +0000 | [diff] [blame] | 143 | "VibrationElement.cpp", |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 144 | ], |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 145 | } |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 146 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 147 | cc_defaults { |
| 148 | name: "libinputflinger_base_defaults", |
| 149 | srcs: [":libinputflinger_base_sources"], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 150 | shared_libs: [ |
| 151 | "libbase", |
Zim | 23457d0 | 2022-08-17 12:57:41 +0100 | [diff] [blame] | 152 | "libbinder", |
Garfield Tan | ff1f1bb | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 153 | "libcutils", |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 154 | "libinput", |
| 155 | "liblog", |
| 156 | "libutils", |
| 157 | ], |
Prabir Pradhan | 29c9533 | 2018-11-14 20:14:11 -0800 | [diff] [blame] | 158 | header_libs: [ |
| 159 | "libinputflinger_headers", |
| 160 | ], |
Colin Cross | 45a1b9c | 2017-04-19 16:56:46 -0700 | [diff] [blame] | 161 | } |
| 162 | |
Prabir Pradhan | 9244aea | 2020-02-05 20:31:40 -0800 | [diff] [blame] | 163 | cc_library_shared { |
| 164 | name: "libinputflinger_base", |
| 165 | defaults: [ |
| 166 | "inputflinger_defaults", |
| 167 | "libinputflinger_base_defaults", |
| 168 | ], |
| 169 | export_header_lib_headers: [ |
| 170 | "libinputflinger_headers", |
| 171 | ], |
| 172 | } |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 173 | |
| 174 | // This target will build everything 'input-related'. This could be useful for |
| 175 | // large refactorings of the input code. This is similar to 'm checkbuild', but |
| 176 | // just for input code. |
| 177 | // Use 'm checkinput' to build, and then (optionally) use 'm installclean' to |
| 178 | // remove any of the installed artifacts that you may not want on your actual |
| 179 | // build. |
| 180 | phony { |
| 181 | name: "checkinput", |
| 182 | required: [ |
| 183 | // native targets |
| 184 | "libinput", |
| 185 | "libinputflinger", |
| 186 | "inputflinger_tests", |
| 187 | "inputflinger_benchmarks", |
| 188 | "libinput_tests", |
| 189 | "libpalmrejection_test", |
| 190 | "libandroid_runtime", |
| 191 | "libinputservice_test", |
| 192 | "Bug-115739809", |
| 193 | "StructLayout_test", |
Siarhei Vishniakou | 007713d | 2022-09-16 14:40:11 -0700 | [diff] [blame] | 194 | |
| 195 | // native fuzzers |
Siarhei Vishniakou | 400294a | 2022-08-03 17:58:57 -0700 | [diff] [blame] | 196 | "inputflinger_latencytracker_fuzzer", |
Siarhei Vishniakou | 007713d | 2022-09-16 14:40:11 -0700 | [diff] [blame] | 197 | "inputflinger_cursor_input_fuzzer", |
| 198 | "inputflinger_keyboard_input_fuzzer", |
| 199 | "inputflinger_multitouch_input_fuzzer", |
| 200 | "inputflinger_switch_input_fuzzer", |
| 201 | "inputflinger_input_reader_fuzzer", |
| 202 | "inputflinger_blocking_queue_fuzzer", |
| 203 | "inputflinger_input_classifier_fuzzer", |
Siarhei Vishniakou | ce55531 | 2022-07-21 17:52:02 -0700 | [diff] [blame] | 204 | |
| 205 | // Java/Kotlin targets |
| 206 | "CtsWindowManagerDeviceTestCases", |
| 207 | "InputTests", |
| 208 | "CtsHardwareTestCases", |
| 209 | "CtsInputTestCases", |
| 210 | "CtsViewTestCases", |
| 211 | "CtsWidgetTestCases", |
| 212 | "FrameworksCoreTests", |
| 213 | "FrameworksServicesTests", |
| 214 | "CtsSecurityTestCases", |
| 215 | "CtsSecurityBulletinHostTestCases", |
| 216 | ], |
| 217 | } |