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