1# Copyright (c) 2022-2024 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("//build/ohos.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17ohos_prebuilt_etc("netstats_notification_base") { 18 source = "notification/resources/base/element/string.json" 19 relative_install_dir = "netmanager_base/resources/base/element" 20 part_name = "netmanager_base" 21 subsystem_name = "communication" 22} 23ohos_prebuilt_etc("netstats_notification_bo_CN") { 24 source = "notification/resources/bo_CN/element/string.json" 25 relative_install_dir = "netmanager_base/resources/bo_CN/element" 26 part_name = "netmanager_base" 27 subsystem_name = "communication" 28} 29ohos_prebuilt_etc("netstats_notification_ug") { 30 source = "notification/resources/ug/element/string.json" 31 relative_install_dir = "netmanager_base/resources/ug/element" 32 part_name = "netmanager_base" 33 subsystem_name = "communication" 34} 35ohos_prebuilt_etc("netstats_notification_zh_CN") { 36 source = "notification/resources/zh_CN/element/string.json" 37 relative_install_dir = "netmanager_base/resources/zh_CN/element" 38 part_name = "netmanager_base" 39 subsystem_name = "communication" 40} 41ohos_prebuilt_etc("netstats_notification_zh_HK") { 42 source = "notification/resources/zh_HK/element/string.json" 43 relative_install_dir = "netmanager_base/resources/zh_HK/element" 44 part_name = "netmanager_base" 45 subsystem_name = "communication" 46} 47ohos_prebuilt_etc("netstats_notification_zh_TW") { 48 source = "notification/resources/zh_TW/element/string.json" 49 relative_install_dir = "netmanager_base/resources/zh_TW/element" 50 part_name = "netmanager_base" 51 subsystem_name = "communication" 52} 53ohos_prebuilt_etc("netstats_notification_zz_ZX") { 54 source = "notification/resources/zz_ZX/element/string.json" 55 relative_install_dir = "netmanager_base/resources/zz_ZX/element" 56 part_name = "netmanager_base" 57 subsystem_name = "communication" 58} 59 60ohos_prebuilt_etc("netstats_notification_icon") { 61 source = "notification/resources/network_ic.png" 62 relative_install_dir = "netmanager_base/resources" 63 part_name = "netmanager_base" 64 subsystem_name = "communication" 65} 66 67ohos_prebuilt_etc("netstats_notification_locale") { 68 source = "notification/resources/locale_to_resourcePath.json" 69 relative_install_dir = "netmanager_base/resources" 70 part_name = "netmanager_base" 71 subsystem_name = "communication" 72} 73 74config("net_service_common_config") { 75 # header file path 76 include_dirs = [ "$INNERKITS_ROOT/netconnclient/include/proxy" ] 77 78 cflags = [ 79 "-fstack-protector-strong", 80 "-D_FORTIFY_SOURCE=2", 81 "-O2", 82 ] 83 84 cflags_cc = [ 85 "-fstack-protector-strong", 86 "-D_FORTIFY_SOURCE=2", 87 "-O2", 88 ] 89} 90 91ohos_shared_library("net_service_common") { 92 sanitize = { 93 cfi = true 94 cfi_cross_dso = true 95 boundary_sanitize = true 96 ubsan = true 97 debug = false 98 } 99 100 branch_protector_ret = "pac_ret" 101 102 sources = [ 103 "src/app_state_aware.cpp", 104 "src/broadcast_manager.cpp", 105 "src/net_manager_center.cpp", 106 "src/net_settings.cpp", 107 "src/route_utils.cpp", 108 ] 109 110 include_dirs = [ 111 "include", 112 "$NETMANAGER_BASE_ROOT/utils/log/include", 113 "$INNERKITS_ROOT/include", 114 "$INNERKITS_ROOT/netconnclient/include", 115 "$INNERKITS_ROOT/netmanagernative/include", 116 "$INNERKITS_ROOT/netstatsclient/include", 117 "$NETCONNMANAGER_COMMON_DIR/include", 118 "$NETMANAGER_BASE_ROOT/utils/log/include", 119 "$NETSYSCONTROLLER_ROOT_DIR/include", 120 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 121 ] 122 123 public_configs = [ ":net_service_common_config" ] 124 125 deps = [ 126 ":netstats_notification_base", 127 ":netstats_notification_bo_CN", 128 ":netstats_notification_icon", 129 ":netstats_notification_locale", 130 ":netstats_notification_ug", 131 ":netstats_notification_zh_CN", 132 ":netstats_notification_zh_HK", 133 ":netstats_notification_zh_TW", 134 ":netstats_notification_zz_ZX", 135 "$INNERKITS_ROOT/netconnclient:net_conn_parcel", 136 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 137 ] 138 139 external_deps = [ 140 "ability_base:want", 141 "ability_runtime:app_manager", 142 "bounds_checking_function:libsec_shared", 143 "c_utils:utils", 144 "common_event_service:cesfwk_innerkits", 145 "ffrt:libffrt", 146 "ipc:ipc_core", 147 "jsoncpp:jsoncpp", 148 "samgr:samgr_proxy", 149 ] 150 151 defines = [ 152 "NETMGR_LOG_TAG = \"NetConnManager\"", 153 "LOG_DOMAIN = 0xD0015B0", 154 ] 155 156 if (enable_netmgr_debug) { 157 defines += [ "NETMGR_DEBUG" ] 158 } 159 160 external_deps += [ "hilog:libhilog" ] 161 162 part_name = "netmanager_base" 163 subsystem_name = "communication" 164} 165