• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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")
15import("//foundation/multimodalinput/input/multimodalinput_mini.gni")
16
17defines = input_default_defines
18
19config("mmi_libudev_public_config") {
20  include_dirs = [ "include" ]
21}
22
23config("mmi_libudev_config") {
24  include_dirs = [ "${mmi_path}/util/common/include" ]
25}
26
27ohos_static_library("mmi_libudev") {
28  public_configs = [ ":mmi_libudev_public_config" ]
29  configs = [ ":mmi_libudev_config" ]
30
31  sources = [ "src/udev_device.cpp" ]
32  branch_protector_ret = "pac_ret"
33  sanitize = {
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37  }
38  external_deps = [ "hilog:libhilog" ]
39
40  defines += [ "MMI_DISABLE_LOG_TRACE" ]
41  part_name = "input"
42  subsystem_name = "multimodalinput"
43}
44
45import("//build/test.gni")
46output_path = "input/input"
47
48group("test") {
49  testonly = true
50  deps = [
51    ":e2e-libudev-test",
52    ":libudev-test",
53  ]
54}
55
56ohos_unittest("libudev-test") {
57  module_out_path = output_path
58  include_dirs = [
59    "${mmi_path}/util/common/include",
60  ]
61
62  configs = [
63    ":mmi_libudev_config",
64    ":mmi_libudev_public_config",
65  ]
66
67  sources = [
68    "src/udev_device.cpp",
69    "test/custom_udev_test.cpp",
70  ]
71
72  external_deps = [
73    "googletest:gmock_main",
74    "hilog:libhilog",
75    "libevdev:libevdev",
76  ]
77
78  defines += [ "MMI_DISABLE_LOG_TRACE" ]
79}
80
81ohos_unittest("e2e-libudev-test") {
82  module_out_path = output_path
83
84  sources = [ "test/e2e_udev_test.cpp" ]
85
86  deps = [ "${mmi_path}/frameworks/proxy:libmmi-client" ]
87
88  external_deps = [
89    "c_utils:utilsbase",
90    "eventhandler:libeventhandler",
91    "googletest:gmock_main",
92    "hilog:libhilog_base",
93    "ipc:ipc_core",
94    "libevdev:libevdev",
95  ]
96}
97