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("../../multimodalinput_mini.gni") 16event_filter_path = "${mmi_path}/service/filter" 17 18config("mmi_event_filter_config") { 19 include_dirs = [ 20 "${mmi_path}/interfaces/native/innerkits/common/include", 21 "${mmi_path}/interfaces/native/innerkits/event/include", 22 "${mmi_path}/service/connect_manager/include", 23 "${mmi_path}/service/device_config/include", 24 "${mmi_path}/service/dfx/include", 25 "${mmi_path}/service/event_handler/include", 26 "${mmi_path}/service/device_manager/include", 27 "${mmi_path}/util/common/include", 28 "${mmi_path}/util/network/include", 29 "${mmi_path}/util/socket/include", 30 "${event_filter_path}/include", 31 ] 32} 33 34ohos_source_set("mmi_event_filter_service") { 35 part_name = "input" 36 subsystem_name = "multimodalinput" 37 branch_protector_ret = "pac_ret" 38 sanitize = { 39 cfi = true 40 cfi_cross_dso = true 41 debug = false 42 } 43 sources = [ 44 "${event_filter_path}/src/event_filter_service.cpp", 45 "${event_filter_path}/src/event_filter_stub.cpp", 46 ] 47 48 configs = [ ":mmi_event_filter_config" ] 49 50 external_deps = [ 51 "c_utils:utils", 52 "hilog:libhilog", 53 "ipc:ipc_single", 54 "safwk:system_ability_fwk", 55 ] 56} 57 58ohos_source_set("mmi_event_filter_proxy") { 59 part_name = "input" 60 subsystem_name = "multimodalinput" 61 branch_protector_ret = "pac_ret" 62 sanitize = { 63 cfi = true 64 cfi_cross_dso = true 65 debug = false 66 } 67 sources = [ 68 "${event_filter_path}/src/event_filter_death_recipient.cpp", 69 "${event_filter_path}/src/event_filter_handler.cpp", 70 "${event_filter_path}/src/event_filter_proxy.cpp", 71 ] 72 73 configs = [ ":mmi_event_filter_config" ] 74 75 defines = input_default_defines 76 77 external_deps = [ 78 "bounds_checking_function:libsec_shared", 79 "c_utils:utils", 80 "hilog:libhilog", 81 "hisysevent:libhisysevent", 82 "ipc:ipc_single", 83 "safwk:system_ability_fwk", 84 ] 85 86 if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64") && 87 enhanced_opt) { 88 cflags = [] 89 if (input_feature_enable_pgo && input_feature_product != "default") { 90 cflags += [ 91 "-fprofile-use=" + 92 rebase_path("${input_feature_pgo_path}/libmmi-server.profdata", 93 root_build_dir), 94 "-Wno-error=backend-plugin", 95 "-Wno-profile-instr-out-of-date", 96 "-Wno-profile-instr-unprofiled", 97 "-Oz", 98 ] 99 } 100 if (input_feature_product == "pc" && target_cpu == "arm64") { 101 cflags += [ 102 "-moutline-atomics", 103 "-Oz", 104 ] 105 } 106 } 107} 108