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("//base/notification/common_event_service/event.gni")
15import("//build/ohos.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("cesfwk_core_public_config") {
39  visibility = [ ":*" ]
40
41  include_dirs = [
42    "${ces_core_path}/include",
43    "${ces_innerkits_path}",
44    "${ffrt_path}/interfaces/kits",
45  ]
46}
47
48ohos_shared_library("cesfwk_core") {
49  sanitize = {
50    integer_overflow = true
51    ubsan = true
52    boundary_sanitize = true
53    cfi = true
54    cfi_cross_dso = true
55    debug = false
56  }
57  branch_protector_ret = "pac_ret"
58
59  version_script = "libcesfwk_core.map"
60
61  sources = [
62    "${ces_core_path}/src/ces_xcollie.cpp",
63    "${ces_core_path}/src/common_event.cpp",
64    "${ces_core_path}/src/common_event_death_recipient.cpp",
65    "${ces_core_path}/src/common_event_listener.cpp",
66    "${ces_core_path}/src/common_event_proxy.cpp",
67    "${ces_core_path}/src/common_event_stub.cpp",
68    "${ces_core_path}/src/event_receive_proxy.cpp",
69    "${ces_core_path}/src/event_receive_stub.cpp",
70    "${ces_native_path}/src/async_common_event_result.cpp",
71    "${ces_native_path}/src/common_event_data.cpp",
72    "${ces_native_path}/src/common_event_publish_info.cpp",
73    "${ces_native_path}/src/common_event_subscribe_info.cpp",
74    "${ces_native_path}/src/common_event_subscriber.cpp",
75    "${ces_native_path}/src/matching_skills.cpp",
76  ]
77
78  configs = [ ":cesfwk_core_config" ]
79
80  public_configs = [ ":cesfwk_core_public_config" ]
81
82  defines = []
83
84  external_deps = [
85    "ability_base:want",
86    "c_utils:utils",
87    "eventhandler:libeventhandler",
88    "ffrt:libffrt",
89    "hicollie:libhicollie",
90    "hilog:libhilog",
91    "ipc:ipc_core",
92    "samgr:samgr_proxy",
93  ]
94
95  if (ces_hitrace_usage) {
96    external_deps += [ "hitrace:hitrace_meter" ]
97    defines += [ "HITRACE_METER_ENABLE" ]
98  }
99
100  subsystem_name = "notification"
101  innerapi_tags = [ "platformsdk" ]
102  part_name = "common_event_service"
103}
104