• 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")
17module_output_path = "input/input"
18
19config("event_injection_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "include",
24    "${mmi_path}/util/common/include",
25    "${mmi_path}/interfaces/native/innerkits/common/include",
26    "${mmi_path}/util/json_parser/include",
27  ]
28}
29
30config("event_injection_public_config") {
31  include_dirs = [
32    "include",
33    "${mmi_path}/util/common/include",
34    "${mmi_path}/interfaces/native/innerkits/common/include",
35    "//third_party/FreeBSD/sys/dev/evdev",
36    "${mmi_path}/util/json_parser/include",
37    "${mmi_path}/service/product_type_config/include",
38    "${mmi_path}/service/custom_config_parser/include",
39  ]
40}
41
42ohos_source_set("event-injection") {
43  sources = event_injection_sources
44  branch_protector_ret = "pac_ret"
45  sanitize = {
46    cfi = true
47    cfi_cross_dso = true
48    debug = false
49  }
50  configs = [
51    ":event_injection_config",
52    ":event_injection_public_config",
53  ]
54
55  deps = [
56    "${mmi_path}/service/connect_manager:mmi_connect_manager_proxy",
57    "${mmi_path}/service/filter:mmi_event_filter_service",
58    "${mmi_path}/util:libmmi-util",
59    "${mmi_path}/util:mmi_json_parser",
60    "${mmi_path}/service/custom_config_parser:mmi_custom_config_parser",
61  ]
62
63  external_deps = [
64    "cJSON:cjson",
65    "c_utils:utils",
66    "ipc:ipc_single",
67    "libinput:libinput-third-mmi",
68  ]
69
70  part_name = "input"
71  subsystem_name = "multimodalinput"
72}
73
74ohos_unittest("ut-event-injection-out") {
75  module_out_path = module_output_path
76
77  configs = [ "${mmi_path}:coverage_flags" ]
78
79  cflags = [
80    "-Dprivate=public",
81    "-Dprotected=public",
82  ]
83
84  include_dirs = [
85    "${mmi_path}/frameworks/proxy/event_handler",
86    "${mmi_path}/frameworks/proxy/event_handler/include",
87    "${mmi_path}/frameworks/proxy/module_loader",
88    "${mmi_path}/frameworks/proxy/module_loader/include",
89    "${mmi_path}/util/common",
90    "${mmi_path}/util/common/include",
91    "${mmi_path}/util/network",
92    "${mmi_path}/util/network/include",
93    "${mmi_path}/util/socket",
94    "${mmi_path}/util/socket/include",
95    "${mmi_path}/frameworks/proxy/event_handle",
96    "${mmi_path}/frameworks/proxy/event_handle/include",
97    "${mmi_path}/frameworks/proxy/module_loader",
98    "${mmi_path}/frameworks/proxy/module_loader/include",
99    "${mmi_path}/interfaces/native/innerkits/common/include",
100    "${mmi_path}/interfaces/native/innerkits/proxy/include",
101    "${mmi_path}/interfaces/native/innerkits/event/include",
102    "${mmi_path}/service/include",
103    "${mmi_path}/service/device_scalability/include",
104    "${mmi_path}/service/event_dispatch/include",
105    "${mmi_path}/service/event_handler/include",
106    "${mmi_path}/service/event_standard/include",
107    "${mmi_path}/service/libinput_adapter/include",
108    "${mmi_path}/service/message_handle/include",
109    "${mmi_path}/service/module_loader/include",
110    "${mmi_path}/service/window_manager/include",
111    "${mmi_path}/tools/event_inject/include",
112    "${mmi_path}/uinput",
113    "$root_out_dir/diff_libinput_mmi/export_include",
114  ]
115
116  sources = [
117    "test/device_base_test.cpp",
118    "test/get_device_node_test.cpp",
119    "test/get_device_object_test.cpp",
120    "test/injection_tools_help_func_test.cpp",
121    "test/processing_finger_device_test.cpp",
122    "test/processing_game_pad_device_test.cpp",
123    "test/processing_joystick_device_test.cpp",
124    "test/processing_keyboard_device_test.cpp",
125    "test/processing_mouse_device_test.cpp",
126    "test/processing_pad_device_test.cpp",
127    "test/processing_pen_device_test.cpp",
128    "test/processing_touch_screen_device_test.cpp",
129  ]
130
131  deps = [
132    "${mmi_path}/frameworks/proxy:libmmi-client",
133    "${mmi_path}/service:libmmi-server",
134    "${mmi_path}/tools/event_inject:event-injection",
135    "${mmi_path}/util:libmmi-util",
136  ]
137
138  external_deps = [
139    "cJSON:cjson",
140    "c_utils:utils",
141    "googletest:gmock_main",
142    "googletest:gtest_main",
143    "hilog:libhilog",
144    "image_framework:image_native",
145    "ipc:ipc_single",
146    "libinput:libinput-third-mmi",
147  ]
148}
149
150ohos_executable("mmi-event-injection") {
151  sources = [ "src/mmi_event_simulate_main.cpp" ]
152  branch_protector_ret = "pac_ret"
153  sanitize = {
154    cfi = true
155    cfi_cross_dso = true
156    debug = false
157  }
158  configs = [ ":event_injection_public_config" ]
159
160  deps = [
161    "${mmi_path}/tools/event_inject:event-injection",
162    "${mmi_path}/util:libmmi-util",
163  ]
164  external_deps = [
165    "cJSON:cjson",
166    "c_utils:utils",
167    "libinput:libinput-third-mmi",
168  ]
169  install_enable = true
170  part_name = "input"
171  subsystem_name = "multimodalinput"
172}
173