1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15INPUT_ROOT_DIR = "./.."
16
17if (defined(ohos_lite)) {
18  config("input_hdi_public_config") {
19    visibility = [ ":*" ]
20    include_dirs = [
21      "include",
22      "$INPUT_ROOT_DIR/interfaces/include",
23      "//third_party/bounds_checking_function/include",
24    ]
25  }
26
27  ohos_shared_library("hdi_input") {
28    output_extension = "z.so"
29    sources = [
30      "src/input_controller.c",
31      "src/input_manager.c",
32      "src/input_reporter.c",
33    ]
34
35    public_configs = [ ":input_hdi_public_config" ]
36    include_dirs = []
37
38    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
39    external_deps = [
40      "hdf_core:libhdf_utils",
41      "hilog_lite:hilog_shared",
42    ]
43    defines = [ "__USER__" ]
44
45    cflags = [
46      "-Wall",
47      "-Wextra",
48      "-Werror",
49      "-fsigned-char",
50      "-fno-common",
51      "-fno-strict-aliasing",
52    ]
53
54    subsystem_name = "hdf"
55
56    install_images = [
57      chipset_base_dir,
58      "updater",
59    ]
60    part_name = "drivers_peripheral_input"
61  }
62} else {
63  config("input_hdi_public_config") {
64    visibility = [ ":*" ]
65    include_dirs = [ "$INPUT_ROOT_DIR/interfaces/include" ]
66  }
67
68  ohos_shared_library("hdi_input") {
69    sources = [
70      "src/input_controller.c",
71      "src/input_manager.c",
72      "src/input_reporter.c",
73    ]
74
75    public_configs = [ ":input_hdi_public_config" ]
76    include_dirs = [ "$INPUT_ROOT_DIR/hal/include" ]
77
78    defines = [ "__OHOS__USER__" ]
79
80    cflags = [
81      "-Wall",
82      "-Wextra",
83      "-Werror",
84      "-fsigned-char",
85      "-fno-common",
86      "-fno-strict-aliasing",
87    ]
88
89    subsystem_name = "hdf"
90    if (is_standard_system) {
91      external_deps = [
92        "c_utils:utils",
93        "hdf_core:libhdf_utils",
94        "hilog:libhilog",
95      ]
96    } else {
97      external_deps = [ "hilog:libhilog" ]
98    }
99    install_images = [
100      chipset_base_dir,
101      "updater",
102    ]
103    innerapi_tags = [ "passthrough_indirect" ]
104    part_name = "drivers_peripheral_input"
105  }
106}
107