1// Copyright (C) 2017 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
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "hardware_libhardware_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["hardware_libhardware_license"],
22}
23
24cc_defaults {
25    name: "hid_defaults",
26    cflags: [
27        "-Wall",
28        "-Werror",
29        "-Wextra",
30    ],
31}
32
33cc_library {
34    name: "libhidparser",
35    defaults: ["hid_defaults"],
36    host_supported: true,
37
38    // indended to be used by hal components, thus vendor
39    vendor: true,
40
41    srcs: [
42        "HidGlobal.cpp",
43        "HidItem.cpp",
44        "HidLocal.cpp",
45        "HidParser.cpp",
46        "HidReport.cpp",
47        "HidTree.cpp",
48        "HidUtils.cpp",
49    ],
50    export_include_dirs: ["."],
51
52    target: {
53        android: {
54            cflags: ["-DLOG_TAG=\"HidUtil\""],
55            shared_libs: ["libbase"],
56        },
57    },
58}
59
60//
61// Example of HidParser
62//
63cc_binary_host {
64    name: "hidparser_example",
65    defaults: ["hid_defaults"],
66
67    srcs: [
68        "test/HidParserExample.cpp",
69        "test/TestHidDescriptor.cpp",
70    ],
71    static_libs: ["libhidparser"],
72
73    local_include_dirs: ["test"],
74}
75
76//
77// Another example of HidParser
78//
79cc_binary_host {
80    name: "hidparser_example2",
81    defaults: ["hid_defaults"],
82
83    srcs: [
84        "test/HidParserExample2.cpp",
85        "test/TestHidDescriptor.cpp",
86    ],
87    static_libs: ["libhidparser"],
88
89    local_include_dirs: ["test"],
90}
91
92//
93// Test for TriState template
94//
95cc_test_host {
96    name: "tristate_test",
97    defaults: ["hid_defaults"],
98
99    srcs: ["test/TriStateTest.cpp"],
100
101    local_include_dirs: ["test"],
102}
103
104//
105// Test for HidUtils
106//
107cc_test_host {
108    name: "hid_utils_test",
109    defaults: ["hid_defaults"],
110
111    srcs: ["test/CopyBitsTest.cpp"],
112
113    shared_libs: [
114        "libhidparser",
115    ],
116
117    local_include_dirs: ["test"],
118}
119
120