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("ans_targets") { 18 deps = [ ":libans" ] 19} 20 21config("public_ans_config") { 22 include_dirs = [ 23 "${services_path}/ans/include", 24 "${core_path}/include", 25 ] 26} 27 28ohos_shared_library("libans") { 29 sanitize = { 30 integer_overflow = true 31 ubsan = true 32 boundary_sanitize = true 33 cfi = true 34 cfi_cross_dso = true 35 debug = false 36 } 37 branch_protector_ret = "pac_ret" 38 39 shlib_type = "sa" 40 version_script = "libans.map" 41 include_dirs = [ 42 "include", 43 "${ffrt_path}/interfaces/kits", 44 ] 45 46 sources = [ 47 "src/access_token_helper.cpp", 48 "src/advanced_notification_event_service.cpp", 49 "src/advanced_notification_inline.cpp", 50 "src/advanced_notification_live_view_service.cpp", 51 "src/advanced_notification_publish_service.cpp", 52 "src/advanced_notification_reminder_service.cpp", 53 "src/advanced_notification_service.cpp", 54 "src/advanced_notification_service_ability.cpp", 55 "src/advanced_notification_slot_service.cpp", 56 "src/advanced_notification_subscriber_service.cpp", 57 "src/advanced_notification_utils.cpp", 58 "src/bundle_manager_helper.cpp", 59 "src/event_report.cpp", 60 "src/notification_config_parse.cpp", 61 "src/notification_dialog.cpp", 62 "src/notification_dialog_manager.cpp", 63 "src/notification_local_live_view_subscriber_manager.cpp", 64 "src/notification_preferences.cpp", 65 "src/notification_preferences_database.cpp", 66 "src/notification_preferences_info.cpp", 67 "src/notification_rdb_data_mgr.cpp", 68 "src/notification_slot_filter.cpp", 69 "src/notification_subscriber_manager.cpp", 70 "src/notification_timer_info.cpp", 71 "src/permission_filter.cpp", 72 "src/reminder_config_change_observer.cpp", 73 "src/reminder_data_manager.cpp", 74 "src/reminder_event_manager.cpp", 75 "src/reminder_timer_info.cpp", 76 "src/system_event_observer.cpp", 77 ] 78 79 configs = [ ":public_ans_config" ] 80 81 defines = [] 82 cflags = [] 83 84 deps = [ 85 "${frameworks_module_ans_path}:ans_innerkits", 86 "../ans:ans.para", 87 "../ans:ans.para.dac", 88 "//third_party/icu/icu4c:shared_icuuc", 89 "//third_party/libxml2:libxml2", 90 ] 91 92 if (is_double_framework) { 93 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 94 } 95 96 if (distributed_notification_supported) { 97 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 98 deps += [ "${services_path}/distributed:libans_distributed" ] 99 include_dirs += [ "${services_path}/distributed/include" ] 100 } 101 102 external_deps = [ 103 "ability_runtime:ability_manager", 104 "ability_runtime:app_manager", 105 "ability_runtime:wantagent_innerkits", 106 "access_token:libaccesstoken_sdk", 107 "access_token:libtokenid_sdk", 108 "bundle_framework:appexecfwk_base", 109 "bundle_framework:appexecfwk_core", 110 "c_utils:utils", 111 "common_event_service:cesfwk_innerkits", 112 "data_share:datashare_common", 113 "data_share:datashare_consumer", 114 "device_manager:devicemanagersdk", 115 "ffrt:libffrt", 116 "i18n:intl_util", 117 "image_framework:image_native", 118 "init:libbegetutil", 119 "kv_store:distributeddata_inner", 120 "os_account:os_account_innerkits", 121 "relational_store:native_rdb", 122 "resource_management:global_resmgr", 123 "time_service:time_client", 124 ] 125 external_deps += component_external_deps 126 127 if (device_usage) { 128 external_deps += [ "device_usage_statistics:usagestatsinner" ] 129 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 130 } 131 132 if (hisysevent_usage) { 133 cflags += [ "-DHAS_HISYSEVENT_PART" ] 134 external_deps += [ "hisysevent:libhisysevent" ] 135 } 136 137 if (standby_enable) { 138 external_deps += [ "device_standby:standby_innerkits" ] 139 defines += [ "DEVICE_STANDBY_ENABLE" ] 140 } 141 142 if (player_framework) { 143 external_deps += [ "player_framework:media_client" ] 144 defines += [ "PLAYER_FRAMEWORK_ENABLE" ] 145 } 146 147 if (ans_hitrace_usage) { 148 external_deps += [ "hitrace:hitrace_meter" ] 149 defines += [ "HITRACE_METER_ENABLE" ] 150 } 151 152 subsystem_name = "${subsystem_name}" 153 part_name = "${component_name}" 154} 155 156ohos_prebuilt_etc("ans.para") { 157 source = "etc/ans.para" 158 relative_install_dir = "param" 159 subsystem_name = "${subsystem_name}" 160 part_name = "${component_name}" 161} 162 163ohos_prebuilt_etc("ans.para.dac") { 164 source = "etc/ans.para.dac" 165 relative_install_dir = "param" 166 subsystem_name = "${subsystem_name}" 167 part_name = "${component_name}" 168} 169