• 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("//base/notification/common_event_service/event.gni")
15import("//build/config/components/idl_tool/idl.gni")
16
17cflags = [
18  "-fno-math-errno",
19  "-fno-unroll-loops",
20  "-fmerge-all-constants",
21  "-fno-ident",
22  "-Oz",
23  "-flto",
24  "-ffunction-sections",
25  "-fdata-sections",
26]
27
28config("cesfwk_core_config") {
29  visibility = [ ":*" ]
30
31  include_dirs = []
32
33  if (target_cpu == "arm") {
34    cflags += [ "-DBINDER_IPC_32BIT" ]
35  }
36}
37
38config("event_receive_config") {
39  visibility = [ "../*" ]
40
41  include_dirs = [
42    "${ces_core_path}/include",
43    "${ces_innerkits_path}",
44    "${target_gen_dir}",
45  ]
46}
47
48config("cesfwk_core_public_config") {
49  visibility = [ ":*" ]
50
51  include_dirs = [
52    "${ces_core_path}/include",
53    "${ces_innerkits_path}",
54    "${target_gen_dir}",
55  ]
56}
57
58config("common_event_config") {
59  include_dirs = [
60    "${ces_core_path}/include",
61    "${ces_innerkits_path}",
62    "${target_gen_dir}",
63  ]
64}
65
66idl_gen_interface("common_event_interface") {
67  sources = [ "ICommonEvent.idl" ]
68  log_domainid = "0xD001202"
69  log_tag = "Ces"
70  subsystem_name = "notification"
71  part_name = "common_event_service"
72}
73
74ohos_source_set("common_event_proxy") {
75  sanitize = {
76    integer_overflow = true
77    ubsan = true
78    boundary_sanitize = true
79    cfi = true
80    cfi_cross_dso = true
81    debug = false
82  }
83  public_configs = [ ":common_event_config" ]
84  output_values = get_target_outputs(":common_event_interface")
85  sources = filter_include(output_values, [ "*_proxy.cpp" ])
86  deps = [ ":common_event_interface" ]
87  external_deps = [
88    "ability_base:want",
89    "c_utils:utils",
90    "hilog:libhilog",
91    "ipc:ipc_core",
92    "samgr:samgr_proxy",
93  ]
94  subsystem_name = "notification"
95  part_name = "common_event_service"
96}
97
98ohos_source_set("common_event_stub") {
99  sanitize = {
100    integer_overflow = true
101    ubsan = true
102    boundary_sanitize = true
103    cfi = true
104    cfi_cross_dso = true
105    debug = false
106  }
107  public_configs = [ ":common_event_config" ]
108  output_values = get_target_outputs(":common_event_interface")
109  sources = filter_include(output_values, [ "*_stub.cpp" ])
110  deps = [ ":common_event_interface" ]
111  external_deps = [
112    "ability_base:want",
113    "c_utils:utils",
114    "hilog:libhilog",
115    "ipc:ipc_core",
116    "samgr:samgr_proxy",
117  ]
118  subsystem_name = "notification"
119  part_name = "common_event_service"
120}
121
122idl_gen_interface("event_receive_interface") {
123  sources = [ "IEventReceive.idl" ]
124  log_domainid = "0xD001202"
125  log_tag = "Ces"
126  subsystem_name = "notification"
127  part_name = "common_event_service"
128}
129
130ohos_source_set("event_receive_proxy") {
131  sanitize = {
132    integer_overflow = true
133    ubsan = true
134    boundary_sanitize = true
135    cfi = true
136    cfi_cross_dso = true
137    debug = false
138  }
139  public_configs = [ ":event_receive_config" ]
140  output_values = get_target_outputs(":event_receive_interface")
141  sources = filter_include(output_values, [ "*_proxy.cpp" ])
142  deps = [ ":event_receive_interface" ]
143  external_deps = [
144    "ability_base:want",
145    "c_utils:utils",
146    "hilog:libhilog",
147    "ipc:ipc_core",
148    "samgr:samgr_proxy",
149  ]
150  subsystem_name = "notification"
151  part_name = "common_event_service"
152}
153
154ohos_source_set("event_receive_stub") {
155  sanitize = {
156    integer_overflow = true
157    ubsan = true
158    boundary_sanitize = true
159    cfi = true
160    cfi_cross_dso = true
161    debug = false
162  }
163  public_configs = [ ":event_receive_config" ]
164  output_values = get_target_outputs(":event_receive_interface")
165  sources = filter_include(output_values, [ "*_stub.cpp" ])
166  deps = [ ":event_receive_interface" ]
167  external_deps = [
168    "ability_base:want",
169    "c_utils:utils",
170    "hilog:libhilog",
171    "ipc:ipc_core",
172    "samgr:samgr_proxy",
173  ]
174  subsystem_name = "notification"
175  part_name = "common_event_service"
176}
177
178ohos_shared_library("cesfwk_core") {
179  sanitize = {
180    integer_overflow = true
181    ubsan = true
182    boundary_sanitize = true
183    cfi = true
184    cfi_cross_dso = true
185    debug = false
186  }
187  branch_protector_ret = "pac_ret"
188
189  version_script = "libcesfwk_core.map"
190
191  sources = [
192    "${ces_core_path}/src/ces_xcollie.cpp",
193    "${ces_core_path}/src/common_event.cpp",
194    "${ces_core_path}/src/common_event_death_recipient.cpp",
195    "${ces_core_path}/src/common_event_listener.cpp",
196    "${ces_native_path}/src/async_common_event_result.cpp",
197    "${ces_native_path}/src/common_event_data.cpp",
198    "${ces_native_path}/src/common_event_publish_info.cpp",
199    "${ces_native_path}/src/common_event_subscribe_info.cpp",
200    "${ces_native_path}/src/common_event_subscriber.cpp",
201    "${ces_native_path}/src/matching_skills.cpp",
202  ]
203
204  configs = [ ":cesfwk_core_config" ]
205
206  public_configs = [ ":cesfwk_core_public_config" ]
207
208  defines = []
209
210  deps = [
211    ":common_event_proxy",
212    ":common_event_stub",
213    ":event_receive_proxy",
214    ":event_receive_stub",
215  ]
216  external_deps = [
217    "ability_base:want",
218    "c_utils:utils",
219    "eventhandler:libeventhandler",
220    "ffrt:libffrt",
221    "hicollie:libhicollie",
222    "hilog:libhilog",
223    "ipc:ipc_core",
224    "samgr:samgr_proxy",
225  ]
226
227  if (ces_hitrace_usage) {
228    external_deps += [ "hitrace:hitrace_meter" ]
229    defines += [ "HITRACE_METER_ENABLE" ]
230  }
231
232  subsystem_name = "notification"
233  innerapi_tags = [ "platformsdk" ]
234  part_name = "common_event_service"
235}
236