1# Copyright (c) 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("//build/test.gni")
16import("../../../multimodalinput_mini.gni")
17
18module_output_path = "multimodalinput/mmi_unit_out"
19
20config("mmi_anco_channel_config") {
21  include_dirs = [
22    "include",
23    "${mmi_path}/interfaces/native/innerkits/event/include",
24    "${mmi_path}/interfaces/native/innerkits/proxy/include",
25  ]
26
27  if (input_ext_feature_anco) {
28    include_dirs += [ "${mmi_ext_path}/anco_uds_manager/include" ]
29  }
30}
31
32ohos_source_set("mmi_anco_channel_proxy") {
33  branch_protector_ret = "pac_ret"
34
35  defines = input_default_defines
36
37  sources = [
38    "${mmi_path}/frameworks/proxy/events/src/i_anco_consumer.cpp",
39    "src/anco_channel_death_recipient.cpp",
40    "src/anco_channel_proxy.cpp",
41  ]
42  branch_protector_ret = "pac_ret"
43  sanitize = {
44    cfi = true
45    cfi_cross_dso = true
46    debug = false
47  }
48
49  configs = [ ":mmi_anco_channel_config" ]
50
51  public_configs = [ ":mmi_anco_channel_config" ]
52
53  deps = [ "${mmi_path}/util:libmmi-util" ]
54
55  external_deps = [
56    "hilog:libhilog",
57    "ipc:ipc_single",
58  ]
59
60  part_name = "${mmi_part_name}"
61  subsystem_name = "${mmi_subsystem_name}"
62}
63
64ohos_source_set("mmi_anco_channel_stub") {
65  branch_protector_ret = "pac_ret"
66
67  defines = input_default_defines
68
69  sources = [
70    "${mmi_path}/frameworks/proxy/events/src/i_anco_consumer.cpp",
71    "src/anco_channel.cpp",
72    "src/anco_channel_stub.cpp",
73  ]
74  branch_protector_ret = "pac_ret"
75  sanitize = {
76    cfi = true
77    cfi_cross_dso = true
78    debug = false
79  }
80
81  configs = [ ":mmi_anco_channel_config" ]
82
83  public_configs = [ ":mmi_anco_channel_config" ]
84
85  deps = [ "${mmi_path}/util:libmmi-util" ]
86
87  external_deps = [
88    "hilog:libhilog",
89    "ipc:ipc_single",
90  ]
91
92  part_name = "${mmi_part_name}"
93  subsystem_name = "${mmi_subsystem_name}"
94}
95
96ohos_unittest("AncoChannelStubTest") {
97  module_out_path = module_output_path
98
99  include_dirs = [
100    "${mmi_path}/common/anco/comm/include",
101    "${mmi_path}/interfaces/native/innerkits/proxy/include",
102  ]
103
104  cflags = [
105    "-Dprivate=public",
106    "-Dprotected=public",
107  ]
108
109  deps = [
110    "${mmi_path}/util:libmmi-util",
111    "//third_party/googletest:gmock_main",
112  ]
113
114  sources = [
115    "${mmi_path}/frameworks/proxy/events/src/i_anco_consumer.cpp",
116    "src/anco_channel_stub.cpp",
117    "test/anco_channel_stub_ex_test.cpp",
118    "test/mock.cpp",
119  ]
120
121  external_deps = [
122    "c_utils:utils",
123    "hilog:libhilog",
124    "ipc:ipc_single",
125  ]
126}
127