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
14INPUT_ROOT_DIR = "./../.."
15
16if (defined(ohos_lite)) {
17  import("//build/lite/config/component/lite_component.gni")
18  import("//build/lite/config/test.gni")
19} else {
20  import("//build/ohos.gni")
21  import("//build/test.gni")
22}
23
24if (defined(ohos_lite)) {
25  unittest("hdf_peripheral_input_test") {
26    output_extension = "bin"
27    output_dir = "$root_out_dir/test/unittest/hdf"
28    include_dirs = [
29      "//third_party/googletest/googletest/include",
30      "//third_party/bounds_checking_function/include",
31      "$INPUT_ROOT_DIR/hal/include",
32      "$INPUT_ROOT_DIR/interfaces/include",
33      "$INPUT_ROOT_DIR/utils/include",
34    ]
35
36    sources = [ "./common/hdi_input_test.cpp" ]
37    cflags = [
38      "-Wall",
39      "-Wextra",
40      "-Werror",
41      "-fsigned-char",
42      "-fno-common",
43      "-fno-strict-aliasing",
44    ]
45    if (ohos_build_compiler != "clang") {
46      cflags += [
47        "-Wno-format",
48        "-Wno-format-extra-args",
49      ]
50    }
51    public_deps = [
52      "$INPUT_ROOT_DIR/hal:hdi_input",
53      "//third_party/bounds_checking_function:libsec_shared",
54    ]
55    external_deps = [
56      "hdf_core:libhdf_utils",
57      "hilog_lite:hilog_shared",
58    ]
59  }
60} else {
61  module_output_path = "drivers_peripheral_input/input"
62  ohos_unittest("hdf_unittest_input") {
63    module_out_path = module_output_path
64    include_dirs = [
65      "$INPUT_ROOT_DIR/hal/include",
66      "$INPUT_ROOT_DIR/interfaces/include",
67      "$INPUT_ROOT_DIR/utils/include",
68    ]
69    sources = [ "./common/hdi_input_test.cpp" ]
70    cflags = [
71      "-Wall",
72      "-Wextra",
73      "-Werror",
74      "-fsigned-char",
75      "-fno-common",
76      "-fno-strict-aliasing",
77    ]
78
79    deps = [ "$INPUT_ROOT_DIR/hal:hdi_input" ]
80    if (is_standard_system) {
81      external_deps = [
82        "c_utils:utils",
83        "hdf_core:libhdf_utils",
84        "hilog:libhilog",
85      ]
86    } else {
87      external_deps = [ "hilog:libhilog" ]
88    }
89  }
90}
91