• 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("//build/test.gni")
16import("../../multimodalinput_mini.gni")
17
18ohos_source_set("input-manager") {
19  sources = [ "src/input_manager_command.cpp" ]
20  if (input_feature_event_recorder) {
21    sources += [
22      "src/device_manager.cpp",
23      "src/event_recorder.cpp",
24      "src/event_replayer.cpp",
25      "src/input_device.cpp",
26      "src/input_replay_command.cpp",
27    ]
28  }
29  branch_protector_ret = "pac_ret"
30  sanitize = {
31    cfi = true
32    cfi_cross_dso = true
33    debug = false
34  }
35  include_dirs = [
36    "include",
37    "${mmi_path}/util/common/include",
38    "${mmi_path}/frameworks/proxy/events/include",
39    "${mmi_path}/frameworks/proxy/event_handler/include",
40    "${mmi_path}/frameworks/proxy/module_loader/include",
41    "${mmi_path}/service/event_handler/include",
42    "${mmi_path}/service/custom_config_parser/include",
43    "${mmi_path}/service/product_property_config/include",
44    "${mmi_path}/util/json_parser/include",
45  ]
46
47  deps = [
48    "${mmi_path}/frameworks/proxy:libmmi-client",
49    "${mmi_path}/util:libmmi-util",
50  ]
51
52  external_deps = [
53    "cJSON:cjson",
54    "c_utils:utils",
55    "eventhandler:libeventhandler",
56    "hilog:libhilog",
57    "image_framework:image_native",
58    "init:libbegetutil",
59    "ipc:ipc_core",
60  ]
61  subsystem_name = "multimodalinput"
62  part_name = "input"
63}
64
65ohos_executable("uinput") {
66  defines = input_default_defines
67  sources = [ "src/main.cpp" ]
68  configs = [ "${mmi_path}:coverage_flags" ]
69  include_dirs = [
70    "include",
71    "${mmi_path}/interfaces/native/innerkits/event/include",
72  ]
73  branch_protector_ret = "pac_ret"
74  sanitize = {
75    cfi = true
76    cfi_cross_dso = true
77    debug = false
78  }
79  deps = [
80    "${mmi_path}/tools/inject_event:input-manager",
81    "${mmi_path}/service/custom_config_parser:mmi_custom_config_parser",
82    "${mmi_path}/util:mmi_json_parser",
83    ]
84  external_deps = [
85    "c_utils:utils",
86    "hilog:libhilog",
87  ]
88  subsystem_name = "multimodalinput"
89  part_name = "input"
90}
91
92module_output_path = "input/input"
93ohos_unittest("InjectEventTest") {
94  module_out_path = module_output_path
95  configs = [ "${mmi_path}:coverage_flags" ]
96  include_dirs = [
97    "include",
98    "${mmi_path}/service/custom_config_parser/include",
99    "${mmi_path}/service/product_property_config/include",
100    "${mmi_path}/util/json_parser/include"
101    ]
102
103  sources = [ "test/inject_event_test.cpp" ]
104  if (input_feature_event_recorder) {
105    sources += [
106      "test/device_manager_test.cpp",
107      "test/event_recorder_test.cpp",
108      "test/event_replayer_test.cpp",
109      "test/input_device_test.cpp",
110      "test/input_replay_command_test.cpp",
111    ]
112  }
113
114  deps = [
115    "${mmi_path}/frameworks/proxy:libmmi-client",
116    "${mmi_path}/tools/inject_event:input-manager",
117    "${mmi_path}/util:libmmi-util",
118    "${mmi_path}/service/custom_config_parser:mmi_custom_config_parser",
119    "${mmi_path}/util:mmi_json_parser",
120  ]
121
122  if (input_feature_event_recorder) {
123    defines = [ "private = public" ]
124  }
125
126  external_deps = [
127    "c_utils:utils",
128    "eventhandler:libeventhandler",
129    "googletest:gtest_main",
130    "hilog:libhilog",
131    "image_framework:image_native",
132    "ipc:ipc_core",
133  ]
134}
135
136group("inject_event") {
137  testonly = true
138  deps = [ ":InjectEventTest" ]
139}
140