# Copyright (c) 2021~2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/communication/netmanager_base/netmanager_base_config.gni") group("common_target") { deps = [ ":net_bundle_utils", ":net_data_share", ":net_manager_common", "napi_utils:napi_utils", ] } config("netmgr_common_config") { include_dirs = [ "common_utils/include", "log/include", "errorcode_utils/include", "$INNERKITS_ROOT/include", "$INNERKITS_ROOT/netconnclient/include", "$INNERKITS_ROOT/netpolicyclient/include", "$INNERKITS_ROOT/netstatsclient/include", ] cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] } ohos_shared_library("net_manager_common") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" sources = [ "common_utils/src/base64_utils.cpp", "common_utils/src/event_report.cpp", "common_utils/src/netmanager_base_common_utils.cpp", "common_utils/src/netmanager_base_permission.cpp", "common_utils/src/netmanager_hitrace.cpp", "common_utils/src/tiny_count_down_latch.cpp", "errorcode_utils/src/errorcode_convertor.cpp", "log/src/net_mgr_log_wrapper.cpp", ] defines = [ "NETMGR_LOG_TAG = \"NetMgrCommon\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_debug) { defines += [ "NETMGR_DEBUG" ] } if (is_standard_system) { defines += [ "STANDARD_SYSTEM_ENABLE" ] } public_configs = [ ":netmgr_common_config" ] external_deps = [ "hilog:libhilog" ] external_deps += [ "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_single", ] innerapi_tags = [ "platformsdk" ] part_name = "netmanager_base" subsystem_name = "communication" } config("netmgr_datashare_config") { include_dirs = [ "data_share/include", "log/include", "$INNERKITS_ROOT/include", ] cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] } ohos_shared_library("net_data_share") { sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = [ "data_share/src/net_datashare_utils.cpp", "data_share/src/net_datashare_utils_iface.cpp", ] defines = [ "NETMGR_LOG_TAG = \"NetMgrDataShare\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_debug) { defines += [ "NETMGR_DEBUG" ] } if (is_standard_system) { defines += [ "STANDARD_SYSTEM_ENABLE" ] } public_configs = [ ":netmgr_datashare_config" ] external_deps = [ "ability_base:zuri", "ability_runtime:dataobs_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] innerapi_tags = [ "platformsdk" ] part_name = "netmanager_base" subsystem_name = "communication" } ohos_shared_library("net_bundle_utils") { sanitize = { cfi = true cfi_cross_dso = true debug = false blocklist = "./bundle_utils/net_bundle_utils_blocklist.txt" } include_dirs = [ "bundle_utils/include", "log/include", "$INNERKITS_ROOT/include", ] sources = [ "bundle_utils/src/net_bundle_impl.cpp" ] defines = [ "NETMGR_LOG_TAG = \"NetMgrBundleUtils\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_debug) { defines += [ "NETMGR_DEBUG" ] } if (is_standard_system) { defines += [ "STANDARD_SYSTEM_ENABLE" ] } external_deps = [ "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] innerapi_tags = [ "platformsdk" ] part_name = "netmanager_base" subsystem_name = "communication" }