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