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