• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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
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("native_module_config") {
29  visibility = [ ":*" ]
30
31  include_dirs = []
32
33  if (target_cpu == "arm") {
34    cflags += [ "-DBINDER_IPC_32BIT" ]
35  }
36}
37
38ohos_shared_library("notificationmanager") {
39  sanitize = {
40    integer_overflow = true
41    ubsan = true
42    boundary_sanitize = true
43    cfi = true
44    cfi_cross_dso = true
45    debug = false
46  }
47  branch_protector_ret = "pac_ret"
48
49  include_dirs = [
50    "../../include",
51    "../../include/manager",
52  ]
53
54  configs = [ ":native_module_config" ]
55
56  sources = [
57    "../ans_template.cpp",
58    "../cancel.cpp",
59    "../common.cpp",
60    "../common_convert_content.cpp",
61    "../common_convert_liveview.cpp",
62    "../common_convert_notification.cpp",
63    "../common_convert_request.cpp",
64    "../common_utils.cpp",
65    "../constant.cpp",
66    "../disable_notification.cpp",
67    "../display_badge.cpp",
68    "../distributed.cpp",
69    "../disturb_mode.cpp",
70    "../enable_notification.cpp",
71    "../get_active.cpp",
72    "../js_ans_dialog_callback.cpp",
73    "../publish.cpp",
74    "../slot.cpp",
75    "init_module.cpp",
76    "local_live_view_subscribe.cpp",
77    "napi_cancel.cpp",
78    "napi_disable_notification.cpp",
79    "napi_display_badge.cpp",
80    "napi_distributed.cpp",
81    "napi_distributed_enable.cpp",
82    "napi_disturb_mode.cpp",
83    "napi_enable_notification.cpp",
84    "napi_get_active.cpp",
85    "napi_local_live_view.cpp",
86    "napi_open_settings.cpp",
87    "napi_publish.cpp",
88    "napi_push.cpp",
89    "napi_push_callback.cpp",
90    "napi_remove_group.cpp",
91    "napi_silent_reminder_enable.cpp",
92    "napi_slot.cpp",
93    "napi_sync_config.cpp",
94    "napi_template.cpp",
95  ]
96
97  deps = [
98    "${frameworks_module_ans_path}:ans_innerkits",
99    "${frameworks_module_reminder_path}:reminder_innerkits",
100  ]
101
102  external_deps = [
103    "ability_base:want",
104    "ability_base:zuri",
105    "ability_runtime:ability_context_native",
106    "ability_runtime:ability_manager",
107    "ability_runtime:abilitykit_native",
108    "ability_runtime:app_context",
109    "ability_runtime:napi_base_context",
110    "ability_runtime:napi_common",
111    "ability_runtime:napi_wantagent_common",
112    "ability_runtime:runtime",
113    "ability_runtime:ui_extension",
114    "ability_runtime:wantagent_innerkits",
115    "access_token:libtokenid_sdk",
116    "ace_engine:ace_uicontent",
117    "c_utils:utils",
118    "ffrt:libffrt",
119    "hilog:libhilog",
120    "hitrace:libhitracechain",
121    "image_framework:image",
122    "ipc:ipc_single",
123    "napi:ace_napi",
124    "relational_store:native_rdb",
125  ]
126
127  defines = []
128
129  if (distributed_notification_service_disable_control) {
130    defines += [ "DISABLE_NOTIFICATION_FEATURE_ENABLE" ]
131  }
132
133  if (distributed_notification_service_feature_badge_manager) {
134    defines += [ "ANS_FEATURE_BADGE_MANAGER" ]
135  }
136
137  if (distributed_notification_service_feature_local_liveview) {
138    defines += [ "ANS_FEATURE_LIVEVIEW_LOCAL_LIVEVIEW" ]
139  }
140
141  if (distributed_notification_service_feature_distributed_db) {
142    defines += [ "ANS_FEATURE_DISTRIBUTED_DB" ]
143  }
144
145  if (distributed_notification_service_feature_disturb_manager) {
146    defines += [ "ANS_FEATURE_DISTURB_MANAGER" ]
147  }
148
149  if (distributed_notification_service_feature_slot_manager) {
150    defines += [ "ANS_FEATURE_SLOT_MANAGER" ]
151  }
152
153  if (distributed_notification_service_feature_additional_config) {
154    defines += [ "ANS_FEATURE_ADDITIONAL_CONFIG" ]
155  }
156
157  if (distributed_notification_service_feature_open_notification_settings) {
158    defines += [ "ANS_FEATURE_OPEN_NOTIFICATION_SETTINGS" ]
159  }
160
161  relative_install_dir = "module"
162  subsystem_name = "${subsystem_name}"
163  part_name = "${component_name}"
164}
165