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    ],
34}
35
36cc_library {
37    name: "libinput",
38    host_supported: true,
39    cflags: [
40        "-Wall",
41        "-Wextra",
42        "-Werror",
43    ],
44    srcs: [
45        "Input.cpp",
46        "InputDevice.cpp",
47        "InputEventLabels.cpp",
48        "Keyboard.cpp",
49        "KeyCharacterMap.cpp",
50        "KeyLayoutMap.cpp",
51        "PropertyMap.cpp",
52        "TouchVideoFrame.cpp",
53        "VelocityControl.cpp",
54        "VelocityTracker.cpp",
55        "VirtualKeyMap.cpp",
56    ],
57
58    clang: true,
59
60    header_libs: ["jni_headers"],
61    export_header_lib_headers: ["jni_headers"],
62
63    shared_libs: [
64        "libbase",
65        "liblog",
66        "libcutils",
67    ],
68
69    static_libs: [
70        "libui-types",
71    ],
72
73    export_static_lib_headers: [
74        "libui-types",
75    ],
76
77    target: {
78        android: {
79            srcs: [
80                "InputTransport.cpp",
81                "android/os/BlockUntrustedTouchesMode.aidl",
82                "android/os/IInputConstants.aidl",
83                "android/os/IInputFlinger.aidl",
84                "android/os/InputEventInjectionResult.aidl",
85                "android/os/InputEventInjectionSync.aidl",
86            ],
87
88            export_shared_lib_headers: ["libbinder"],
89
90            shared_libs: [
91                "libutils",
92                "libbinder",
93                "libui",
94            ],
95
96            static_libs: [
97                "libgui_window_info_static",
98            ],
99
100            export_static_lib_headers: [
101                "libgui_window_info_static",
102            ],
103
104            sanitize: {
105                misc_undefined: ["integer"],
106            },
107        },
108        host: {
109            shared: {
110                enabled: false,
111            },
112            include_dirs: [
113                "frameworks/native/libs/arect/include",
114            ],
115        },
116        linux_glibc: {
117            srcs: [
118                "InputTransport.cpp",
119                "android/os/IInputConstants.aidl",
120                "android/os/IInputFlinger.aidl",
121            ],
122            static_libs: [
123                "libhostgraphics",
124                "libgui_window_info_static",
125            ],
126            shared_libs: [
127                "libbinder",
128            ],
129
130            export_static_lib_headers: [
131                "libgui_window_info_static",
132            ],
133        },
134    },
135
136    aidl: {
137        local_include_dirs: ["."],
138        export_aidl_headers: true,
139        include_dirs: [
140            "frameworks/native/libs/gui",
141        ],
142    },
143}
144
145cc_defaults {
146    name: "libinput_fuzz_defaults",
147    host_supported: true,
148    shared_libs: [
149        "libutils",
150        "libbase",
151        "liblog",
152    ],
153}
154
155cc_fuzz {
156    name: "libinput_fuzz_propertymap",
157    defaults: ["libinput_fuzz_defaults"],
158    srcs: [
159        "PropertyMap.cpp",
160        "PropertyMap_fuzz.cpp",
161    ],
162}
163
164subdirs = ["tests"]
165