• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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/distributed_notification_service/notification.gni")
15import("//build/ohos.gni")
16
17group("napi_reminder") {
18  deps = [
19    "src/reminder:reminderagent",
20    "src/reminder:reminderagentmanager",
21  ]
22}
23
24group("napi_notification") {
25  deps = [
26    ":notification",
27    "src/manager:notificationmanager",
28    "src/subscribe:notificationsubscribe",
29  ]
30}
31
32cflags = [
33  "-fno-math-errno",
34  "-fno-unroll-loops",
35  "-fmerge-all-constants",
36  "-fno-ident",
37  "-Oz",
38  "-flto",
39  "-ffunction-sections",
40  "-fdata-sections",
41]
42
43config("native_module_config") {
44  visibility = [ ":*" ]
45
46  include_dirs = []
47
48  if (target_cpu == "arm") {
49    cflags += [ "-DBINDER_IPC_32BIT" ]
50  }
51}
52
53ohos_shared_library("notification") {
54  sanitize = {
55    integer_overflow = true
56    ubsan = true
57    boundary_sanitize = true
58    cfi = true
59    cfi_cross_dso = true
60    debug = false
61  }
62  branch_protector_ret = "pac_ret"
63
64  include_dirs = [ "include" ]
65
66  configs = [ ":native_module_config" ]
67
68  sources = [
69    "src/ans_template.cpp",
70    "src/cancel.cpp",
71    "src/common.cpp",
72    "src/common_convert_content.cpp",
73    "src/common_convert_liveview.cpp",
74    "src/common_convert_notification.cpp",
75    "src/common_convert_request.cpp",
76    "src/common_utils.cpp",
77    "src/constant.cpp",
78    "src/disable_notification.cpp",
79    "src/display_badge.cpp",
80    "src/distributed.cpp",
81    "src/disturb_mode.cpp",
82    "src/enable_notification.cpp",
83    "src/get_active.cpp",
84    "src/init.cpp",
85    "src/js_ans_dialog_callback.cpp",
86    "src/publish.cpp",
87    "src/remove.cpp",
88    "src/slot.cpp",
89    "src/subscribe.cpp",
90    "src/unsubscribe.cpp",
91  ]
92
93  deps = [
94    "${frameworks_module_ans_path}:ans_innerkits",
95    "${frameworks_module_reminder_path}:reminder_innerkits",
96  ]
97
98  defines = []
99
100  if (distributed_notification_service_feature_badge_manager) {
101    defines += [ "ANS_FEATURE_BADGE_MANAGER" ]
102  }
103
104  if (distributed_notification_service_feature_local_liveview) {
105    defines += [ "ANS_FEATURE_LIVEVIEW_LOCAL_LIVEVIEW" ]
106  }
107
108  if (distributed_notification_service_feature_distributed_db) {
109    defines += [ "ANS_FEATURE_DISTRIBUTED_DB" ]
110  }
111
112  if (distributed_notification_service_feature_disturb_manager) {
113    defines += [ "ANS_FEATURE_DISTURB_MANAGER" ]
114  }
115
116  if (distributed_notification_service_feature_slot_manager) {
117    defines += [ "ANS_FEATURE_SLOT_MANAGER" ]
118  }
119
120  external_deps = [
121    "ability_base:want",
122    "ability_base:zuri",
123    "ability_runtime:ability_manager",
124    "ability_runtime:abilitykit_native",
125    "ability_runtime:app_context",
126    "ability_runtime:napi_common",
127    "ability_runtime:napi_wantagent_common",
128    "ability_runtime:wantagent_innerkits",
129    "c_utils:utils",
130    "ffrt:libffrt",
131    "hilog:libhilog",
132    "hitrace:libhitracechain",
133    "image_framework:image",
134    "ipc:ipc_single",
135    "json:nlohmann_json_static",
136    "libuv:uv",
137    "napi:ace_napi",
138    "relational_store:native_rdb",
139    "resource_management:global_resmgr",
140  ]
141
142  relative_install_dir = "module"
143  subsystem_name = "${subsystem_name}"
144  part_name = "${component_name}"
145}
146