1# Copyright (c) 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_ext/netmanager_ext_config.gni") 16 17config("wearable_distributed_net_manager_config") { 18 include_dirs = [ 19 "include", 20 "$EXT_INNERKITS_ROOT/include", 21 "$EXT_INNERKITS_ROOT/wearabledistributednetclient/include", 22 "$NETMANAGER_EXT_ROOT/utils/log/include", 23 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/include", 24 "$NETWORKSHAREMANAGER_UTILS_DIR/event_report/include", 25 "${target_gen_dir}", 26 ] 27 28 defines = [ 29 "NETMGR_LOG_TAG = \"WearableDistributedNetManager\"", 30 "LOG_DOMAIN = 0xD0015B0", 31 "WEARABLE_DISTRIBUTED_NET_CONFIG_PATH = \"/system/etc/communication/netmanager_ext/wearable_distributed_net_link_info.json\"", 32 ] 33 34 if (enable_netmgr_ext_debug) { 35 defines += [ "NETMGR_DEBUG" ] 36 } 37 38 if (battery_manager_switch_enable) { 39 include_dirs += [ "$BATTERY_INNER_API/native/include" ] 40 } 41} 42 43wearable_distributed_net_manager_sources = [ 44 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_agent.cpp", 45 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_config_forward.cpp", 46 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_link_info.cpp", 47 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_management.cpp", 48 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_service.cpp", 49 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_static_configuration.cpp", 50 "$WEARABLE_DISTRIBUTED_NET_MANAGER_SOURCE_DIR/src/wearable_distributed_net_supplier_info.cpp", 51 "${target_gen_dir}/../../interfaces/innerkits/wearabledistributednetclient/wearable_distributed_net_stub.cpp", 52] 53 54wearable_distributed_net_manager_deps = [ 55 "$EXT_INNERKITS_ROOT/wearabledistributednetclient:wearable_distributed_net_manager_if", 56 "$EXT_INNERKITS_ROOT/wearabledistributednetclient:wearable_distributed_net_service", 57 "$NETMANAGER_EXT_ROOT/utils:net_event_report", 58] 59 60wearable_distributed_net_manager_external_deps = [ 61 "ability_base:want", 62 "ability_base:zuri", 63 "ability_runtime:app_manager", 64 "bundle_framework:appexecfwk_base", 65 "bundle_framework:appexecfwk_core", 66 "cJSON:cjson", 67 "c_utils:utils", 68 "common_event_service:cesfwk_innerkits", 69 "eventhandler:libeventhandler", 70 "ffrt:libffrt", 71 "hilog:libhilog", 72 "hisysevent:libhisysevent", 73 "hitrace:hitrace_meter", 74 "ipc:ipc_core", 75 "netmanager_base:net_conn_manager_if", 76 "netmanager_base:net_conn_parcel", 77 "netmanager_base:net_data_share", 78 "netmanager_base:net_manager_common", 79 "netmanager_base:net_native_manager_if", 80 "netmanager_base:net_service_common", 81 "netmanager_base:netsys_client", 82 "netmanager_base:netsys_controller", 83 "netmanager_base:socket_permission", 84 "safwk:system_ability_fwk", 85 "samgr:samgr_proxy", 86] 87 88ohos_shared_library("wearable_distributed_net_manager") { 89 sanitize = { 90 cfi = true 91 cfi_cross_dso = true 92 debug = false 93 } 94 95 branch_protector_ret = "pac_ret" 96 97 configs = [ ":wearable_distributed_net_manager_config" ] 98 99 sources = wearable_distributed_net_manager_sources 100 deps = wearable_distributed_net_manager_deps 101 external_deps = wearable_distributed_net_manager_external_deps 102 103 cflags = memory_optimization_cflags 104 cflags += [ 105 "-fstack-protector-strong", 106 "-D_FORTIFY_SOURCE=2", 107 "-O2", 108 ] 109 110 if (battery_manager_switch_enable) { 111 external_deps += [ "battery_manager:batterysrv_client" ] 112 } 113 114 cflags_cc = memory_optimization_cflags_cc 115 cflags_cc += [ 116 "-fstack-protector-strong", 117 "-D_FORTIFY_SOURCE=2", 118 "-O2", 119 ] 120 121 ldflags = memory_optimization_ldflags 122 123 part_name = "netmanager_ext" 124 subsystem_name = "communication" 125} 126 127ohos_prebuilt_etc("wearable_distributed_net_link_info") { 128 source = "$NETMANAGER_EXT_ROOT/services/wearabledistributednetmanager/config/wearable_distributed_net_link_info.json" 129 install_enable = true 130 relative_install_dir = "communication/netmanager_ext" 131 part_name = "netmanager_ext" 132 subsystem_name = "communication" 133} 134