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/config/components/idl_tool/idl.gni") 15import("//build/ohos.gni") 16import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") 17 18config("net_conn_manager_if_config") { 19 include_dirs = [ 20 "include", 21 "$NETMANAGER_EXT_ROOT/utils/log/include", 22 "$EXT_INNERKITS_ROOT/include", 23 "$EXT_INNERKITS_ROOT/wearabledistributednetclient/include", 24 "${target_gen_dir}", 25 ] 26 27 cflags = [] 28 if (is_double_framework) { 29 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 30 } 31 if (target_cpu == "arm") { 32 cflags += [ "-DBINDER_IPC_32BIT" ] 33 } 34 if (is_standard_system) { 35 cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] 36 } 37 if (defined(build_public_version) && build_public_version) { 38 cflags += [ "-DBUILD_PUBLIC_VERSION" ] 39 } 40 41 cflags += [ 42 "-fstack-protector-strong", 43 "-D_FORTIFY_SOURCE=2", 44 "-O2", 45 ] 46 47 cflags_cc = [ 48 "-fstack-protector-strong", 49 "-D_FORTIFY_SOURCE=2", 50 "-O2", 51 ] 52 defines = [ 53 "NETMGR_LOG_TAG = \"WearableDistributedNetManager\"", 54 "LOG_DOMAIN = 0xD0015B0", 55 ] 56 57 if (enable_netmgr_ext_debug) { 58 defines += [ "NETMGR_DEBUG" ] 59 } 60} 61 62idl_interface_sources = [ 63 "${target_gen_dir}/wearable_distributed_net_proxy.cpp", 64 "${target_gen_dir}/wearable_distributed_net_stub.cpp", 65] 66 67idl_gen_interface("wearable_distributed_net_service") { 68 src_idl = rebase_path("IWearableDistributedNet.idl") 69 dst_file = string_join(",", idl_interface_sources) 70 hitrace = "HITRACE_TAG_ABILITY_MANAGER" 71 log_domainid = "0xD0015B0" 72 log_tag = "WearableDistributedNet" 73} 74 75ohos_shared_library("wearable_distributed_net_manager_if") { 76 sanitize = { 77 cfi = true 78 cfi_cross_dso = true 79 debug = false 80 } 81 82 branch_protector_ret = "pac_ret" 83 84 sources = [ 85 "$WEARABLE_DISTRIBUTED_NET_INNERKITS_SOURCE_DIR/src/wearable_distributed_net_client.cpp", 86 "${target_gen_dir}/wearable_distributed_net_proxy.cpp", 87 ] 88 89 version_script = "libwearable_distributed_net_kits.map" 90 91 public_configs = [ ":net_conn_manager_if_config" ] 92 deps = [ ":wearable_distributed_net_service" ] 93 external_deps = [ 94 "bounds_checking_function:libsec_shared", 95 "c_utils:utils", 96 "hilog:libhilog", 97 "hitrace:hitrace_meter", 98 "ipc:ipc_core", 99 "ipc:ipc_single", 100 "netmanager_base:net_manager_common", 101 "samgr:samgr_proxy", 102 ] 103 104 innerapi_tags = [ "platformsdk" ] 105 part_name = "netmanager_ext" 106 subsystem_name = "communication" 107} 108