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("//foundation/multimodalinput/input/multimodalinput_mini.gni") 16 17defines = input_default_defines 18 19config("mmi_libudev_public_config") { 20 include_dirs = [ "include" ] 21} 22 23config("mmi_libudev_config") { 24 include_dirs = [ "${mmi_path}/util/common/include" ] 25} 26 27ohos_static_library("mmi_libudev") { 28 public_configs = [ ":mmi_libudev_public_config" ] 29 configs = [ ":mmi_libudev_config" ] 30 31 sources = [ "src/udev_device.cpp" ] 32 branch_protector_ret = "pac_ret" 33 sanitize = { 34 cfi = true 35 cfi_cross_dso = true 36 debug = false 37 } 38 external_deps = [ "hilog:libhilog" ] 39 40 defines += [ "MMI_DISABLE_LOG_TRACE" ] 41 part_name = "input" 42 subsystem_name = "multimodalinput" 43} 44 45import("//build/test.gni") 46output_path = "multimodalinput/mmi_unit_out" 47 48group("test") { 49 testonly = true 50 deps = [ 51 ":e2e-libudev-test", 52 ":libudev-test", 53 ] 54} 55 56ohos_unittest("libudev-test") { 57 module_out_path = output_path 58 include_dirs = [ 59 "${mmi_path}/util/common/include", 60 "//third_party/libevdev", 61 ] 62 63 configs = [ 64 ":mmi_libudev_config", 65 ":mmi_libudev_public_config", 66 ] 67 68 sources = [ 69 "src/udev_device.cpp", 70 "test/custom_udev_test.cpp", 71 ] 72 73 external_deps = [ 74 "googletest:gmock_main", 75 "hilog:libhilog", 76 "libevdev:libevdev", 77 ] 78 79 defines += [ "MMI_DISABLE_LOG_TRACE" ] 80} 81 82ohos_unittest("e2e-libudev-test") { 83 module_out_path = output_path 84 include_dirs = [ "//third_party/libevdev" ] 85 86 sources = [ "test/e2e_udev_test.cpp" ] 87 88 deps = [ "${mmi_path}/frameworks/proxy:libmmi-client" ] 89 90 external_deps = [ 91 "c_utils:utilsbase", 92 "eventhandler:libeventhandler", 93 "googletest:gmock_main", 94 "hilog:libhilog_base", 95 "ipc:ipc_core", 96 "libevdev:libevdev", 97 ] 98} 99