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 15// libinput is partially built for the host (used by build time keymap validation tool) 16 17package { 18 // See: http://go/android-license-faq 19 // A large-scale-change added 'default_applicable_licenses' to import 20 // all of the 'license_kinds' from "frameworks_native_license" 21 // to get the below license kinds: 22 // SPDX-license-identifier-Apache-2.0 23 default_applicable_licenses: ["frameworks_native_license"], 24} 25 26filegroup { 27 name: "inputconstants_aidl", 28 srcs: [ 29 "android/os/BlockUntrustedTouchesMode.aidl", 30 "android/os/IInputConstants.aidl", 31 "android/os/InputEventInjectionResult.aidl", 32 "android/os/InputEventInjectionSync.aidl", 33 "android/os/InputConfig.aidl", 34 ], 35} 36 37cc_library { 38 name: "libinput", 39 cpp_std: "c++20", 40 host_supported: true, 41 cflags: [ 42 "-Wall", 43 "-Wextra", 44 "-Werror", 45 ], 46 srcs: [ 47 "Input.cpp", 48 "InputDevice.cpp", 49 "InputEventLabels.cpp", 50 "Keyboard.cpp", 51 "KeyCharacterMap.cpp", 52 "KeyLayoutMap.cpp", 53 "PrintTools.cpp", 54 "PropertyMap.cpp", 55 "TouchVideoFrame.cpp", 56 "VelocityControl.cpp", 57 "VelocityTracker.cpp", 58 "VirtualKeyMap.cpp", 59 ], 60 61 clang: true, 62 63 header_libs: ["jni_headers"], 64 export_header_lib_headers: ["jni_headers"], 65 66 shared_libs: [ 67 "libbase", 68 "liblog", 69 "libcutils", 70 "libvintf", 71 ], 72 73 static_libs: [ 74 "libui-types", 75 ], 76 77 export_static_lib_headers: [ 78 "libui-types", 79 ], 80 81 target: { 82 android: { 83 srcs: [ 84 "InputTransport.cpp", 85 "android/os/IInputFlinger.aidl", 86 ":inputconstants_aidl", 87 ], 88 89 export_shared_lib_headers: ["libbinder"], 90 91 shared_libs: [ 92 "libutils", 93 "libbinder", 94 "libui", 95 ], 96 97 static_libs: [ 98 "libgui_window_info_static", 99 ], 100 101 export_static_lib_headers: [ 102 "libgui_window_info_static", 103 ], 104 105 sanitize: { 106 misc_undefined: ["integer"], 107 }, 108 }, 109 host: { 110 shared: { 111 enabled: false, 112 }, 113 include_dirs: [ 114 "frameworks/native/libs/arect/include", 115 ], 116 }, 117 host_linux: { 118 srcs: [ 119 "InputTransport.cpp", 120 "android/os/IInputConstants.aidl", 121 "android/os/IInputFlinger.aidl", 122 "android/os/InputConfig.aidl", 123 ], 124 static_libs: [ 125 "libhostgraphics", 126 "libgui_window_info_static", 127 ], 128 shared_libs: [ 129 "libbinder", 130 ], 131 132 export_static_lib_headers: [ 133 "libgui_window_info_static", 134 ], 135 }, 136 }, 137 138 aidl: { 139 local_include_dirs: ["."], 140 export_aidl_headers: true, 141 include_dirs: [ 142 "frameworks/native/libs/gui", 143 ], 144 }, 145} 146 147cc_defaults { 148 name: "libinput_fuzz_defaults", 149 host_supported: true, 150 shared_libs: [ 151 "libutils", 152 "libbase", 153 "liblog", 154 ], 155} 156 157cc_fuzz { 158 name: "libinput_fuzz_propertymap", 159 defaults: ["libinput_fuzz_defaults"], 160 srcs: [ 161 "PropertyMap.cpp", 162 "PropertyMap_fuzz.cpp", 163 ], 164} 165 166subdirs = ["tests"] 167