• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    ],
49    export_include_dirs: ["."],
50
51    target: {
52        android: {
53            cflags: ["-DLOG_TAG=\"HidUtil\""],
54            shared_libs: ["libbase"],
55        },
56    },
57}
58
59//
60// Example of HidParser
61//
62cc_binary_host {
63    name: "hidparser_example",
64    defaults: ["hid_defaults"],
65
66    srcs: [
67        "test/HidParserExample.cpp",
68        "test/TestHidDescriptor.cpp",
69    ],
70    static_libs: ["libhidparser"],
71
72    local_include_dirs: ["test"],
73}
74
75//
76// Another example of HidParser
77//
78cc_binary_host {
79    name: "hidparser_example2",
80    defaults: ["hid_defaults"],
81
82    srcs: [
83        "test/HidParserExample2.cpp",
84        "test/TestHidDescriptor.cpp",
85    ],
86    static_libs: ["libhidparser"],
87
88    local_include_dirs: ["test"],
89}
90
91//
92// Test for TriState template
93//
94cc_test_host {
95    name: "tristate_test",
96    defaults: ["hid_defaults"],
97
98    srcs: ["test/TriStateTest.cpp"],
99
100    local_include_dirs: ["test"],
101}
102