1# Copyright (c) 2021-2024 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("./multimodalinput_mini.gni")
16
17config("coverage_flags") {
18  if (input_feature_coverage) {
19    cflags = [ "--coverage" ]
20    ldflags = [ "--coverage" ]
21    cflags_cc = [ "--coverage" ]
22  }
23}
24
25ohos_prebuilt_etc("mmi_uinput.rc") {
26  source = "mmi_uinput.rc"
27  relative_install_dir = "init"
28  part_name = "input"
29  subsystem_name = "multimodalinput"
30}
31
32ohos_prebuilt_etc("multimodalinput.rc") {
33  source = "multimodalinput.cfg"
34  relative_install_dir = "init"
35  part_name = "input"
36  subsystem_name = "multimodalinput"
37}
38
39ohos_executable("uinput_inject") {
40  install_enable = true
41
42  sources = uinput_inject_sources
43  branch_protector_ret = "pac_ret"
44  sanitize = {
45    cfi = true
46    cfi_cross_dso = true
47    debug = false
48  }
49
50  include_dirs = [
51    "${mmi_path}/service/nap_process/include",
52    "${mmi_path}/util/common/include",
53    "${mmi_path}/interfaces/native/innerkits/common/include",
54  ]
55
56  external_deps = [
57    "c_utils:utils",
58    "drivers_interface_input:libinput_proxy_1.0",
59    "hilog:libhilog",
60  ]
61
62  defines = [ "MMI_DISABLE_LOG_TRACE" ]
63
64  cflags = [ "-fstack-protector-strong" ]
65
66  part_name = "input"
67  subsystem_name = "multimodalinput"
68}
69
70group("multimodalinput_mmi_base") {
71  deps = []
72}
73
74group("multimodalinput_mmi_frameworks") {
75  deps = [ "frameworks/proxy:libmmi-client" ]
76}
77
78group("multimodalinput_mmi_service") {
79  deps = [
80    "service:libmmi-server",
81    "tools/inject_event:uinput",
82  ]
83}
84
85group("input_jsapi_group") {
86  deps = []
87  if (support_jsapi) {
88    deps += [
89      "frameworks/napi/gesture_event:gestureevent",
90      "frameworks/napi/intention_code:intentioncode",
91      "frameworks/napi/key_code:keycode",
92      "frameworks/napi/key_event:keyevent",
93      "frameworks/napi/mouse_event:mouseevent",
94      "frameworks/napi/touch_event:touchevent",
95    ]
96    if (input_feature_monitor) {
97      deps += [ "frameworks/napi/input_monitor:inputmonitor" ]
98    }
99    if (input_feature_mouse) {
100      deps += [ "frameworks/napi/pointer:pointer" ]
101    }
102    if (input_feature_keyboard) {
103      deps += [
104        "frameworks/napi/input_consumer:inputconsumer",
105        "frameworks/napi/input_event_client:inputeventclient",
106      ]
107    }
108    if (input_feature_input_device) {
109      deps += [ "frameworks/napi/input_device:inputdevice" ]
110    }
111    if (input_feature_short_key) {
112      deps += [ "frameworks/napi/short_key:shortkey" ]
113    }
114    deps += [ "frameworks/napi/infrared_emitter:infraredemitter" ]
115  }
116}
117
118group("mmi_tests") {
119  testonly = true
120  deps = [
121    "common/anco/comm:AncoChannelStubTest",
122    "frameworks/native/input:OHInputManagerTest",
123    "frameworks/proxy:InputHandlerManagerTest",
124    "frameworks/proxy:InputManagerFilterManualTest",
125    "frameworks/proxy:InputManagerImplTest",
126    "frameworks/proxy:InputManagerInjectTest",
127    "frameworks/proxy:InputManagerManualTest",
128    "frameworks/proxy:InputManagerTest",
129    "frameworks/proxy:KeyEventTest",
130    "frameworks/proxy:PointerEventTest",
131    "frameworks/proxy:ut-mmi-proxy-out",
132    "libudev:test",
133    "service:AccountManagerTest",
134    "service:ApplicationStateObserverTest",
135    "service:ConnectManagerEXTest",
136    "service:ConnectManagerProxyEXTest",
137    "service:ConnectManagerTest",
138    "service:DelegateTaskTest",
139    "service:DeviceConfigTest",
140    "service:DeviceManagerTest",
141    "service:DfxHisysEventTest",
142    "service:DisplayStateManagerTest",
143    "service:EventDispatchTest",
144    "service:EventDumpTest",
145    "service:EventFilterDeathRecipientTest",
146    "service:EventFilterHandlerTest",
147    "service:EventHandlerTest",
148    "service:InfraredEmitterTest",
149    "service:InputDisplayBindHelperTest",
150    "service:InputWindowsManagerEXTest",
151    "service:InputWindowsManagerTest",
152    "service:InterceptorTest",
153    "service:KeyAutoRepeatExTest",
154    "service:KeyCommandTest",
155    "service:KeyEventNormalizeTest",
156    "service:KnuckleDivergentPointTest",
157    "service:KnuckleDrawingManagerTest",
158    "service:KnuckleDynamicDrawingManagerTest",
159    "service:KnuckleGlowPointTest",
160    "service:KnuckleGlowTraceSystemTest",
161    "service:LibinputAdapterTest",
162    "service:ModuleLoaderTest",
163    "service:MonitorTest",
164    "service:NapProcessTest",
165    "service:PermissionHelperTest",
166    "service:ServerMsgHandlerTest",
167    "service:StylusKeyTest",
168    "service:StylusKeyTest",
169    "service:SubscriberTest",
170    "service:TimerManagerTest",
171    "service:event_resample_test",
172    "service:mmi-service-tests",
173    "service/crown_transform_processor/test:CrownTransformProcessorTest",
174    "service/mouse_event_normalize/test:MouseEventNormalizeTest",
175    "service/touch_event_normalize/test:TouchEventNormalizeTests",
176    "test/fuzztest:test",
177    "test/unittest/interfaces:InputNativeTest",
178    "tools/inject_event:InjectEventTest",
179  ]
180
181  if (!use_clang_coverage) {
182    deps += [
183      "service:rust_mmi_test",
184      "util:rust_mmi_key_config_test",
185      "util:ut-mmi-util-out",
186    ]
187  }
188
189  if (input_ext_feature_anco) {
190    deps += [ "${mmi_path}/frameworks/proxy/events/test:InputManagerAncoTest" ]
191  }
192}
193
194group("examples_group") {
195  deps = [ "examples/input_device_display_bind:input_device_display_bind" ]
196}
197