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")
17config("libmmi_virtual_device_config") {
18  visibility = [ ":*" ]
19  include_dirs = [ "include" ]
20}
21
22config("virtual_device_public_config") {
23  include_dirs = [ "include" ]
24}
25
26ohos_source_set("libmmi-virtual-device") {
27  sources = libmmi_virtual_device_sources
28  branch_protector_ret = "pac_ret"
29  sanitize = {
30    cfi = true
31    cfi_cross_dso = true
32    debug = false
33  }
34  configs = [ ":libmmi_virtual_device_config" ]
35
36  external_deps = [
37    "c_utils:utils",
38    "libinput:libinput-third-mmi",
39  ]
40
41  public_configs = [ ":virtual_device_public_config" ]
42
43  part_name = "input"
44  subsystem_name = "multimodalinput"
45}
46
47ohos_executable("vuinput") {
48  sources = [ "src/mmi_virtual_device_main.cpp" ]
49  branch_protector_ret = "pac_ret"
50  sanitize = {
51    cfi = true
52    cfi_cross_dso = true
53    debug = false
54  }
55  configs = [ ":virtual_device_public_config" ]
56
57  deps = [ "${mmi_path}/tools/vuinput:libmmi-virtual-device" ]
58
59  external_deps = [
60    "c_utils:utils",
61    "libinput:libinput-third-mmi",
62  ]
63  install_enable = true
64  part_name = "input"
65  subsystem_name = "multimodalinput"
66}
67
68module_output_path = "multimodalinput/mmi_unit_out"
69ohos_unittest("ut-virtual-device-out") {
70  module_out_path = module_output_path
71  include_dirs = [
72    "${mmi_path}/tools/vuinput/include",
73    "${mmi_path}/util/common",
74    "${mmi_path}/util/common/include",
75    "${mmi_path}/util/network",
76    "${mmi_path}/util/network/include",
77    "${mmi_path}/util/socket",
78    "${mmi_path}/util/socket/include",
79    "$root_out_dir/diff_libinput_mmi/export_include",
80  ]
81
82  sources = [ "test/virtual_device_test.cpp" ]
83
84  configs = [
85    "${mmi_path}:coverage_flags",
86    ":virtual_device_public_config",
87  ]
88
89  deps = [
90    "${mmi_path}/tools/vuinput:libmmi-virtual-device",
91    "${mmi_path}/util:libmmi-util",
92  ]
93
94  external_deps = [
95    "c_utils:utils",
96    "googletest:gmock_main",
97    "googletest:gtest_main",
98    "hilog:libhilog",
99    "libinput:libinput-third-mmi",
100  ]
101}
102