• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/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    "${target_gen_dir}",
21    "include",
22    "include/proxy",
23    "include/proxy/ipccallback",
24    "$EXT_INNERKITS_ROOT/include",
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 += common_cflags
42
43  cflags_cc = common_cflags
44}
45
46ohos_static_library("networkshare_parcel") {
47  sanitize = {
48    cfi = true
49    cfi_cross_dso = true
50    debug = false
51  }
52
53  branch_protector_ret = "pac_ret"
54
55  sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/network_share_request_parcel.cpp" ]
56
57  include_dirs = [
58    "$EXT_INNERKITS_ROOT/include",
59    "$EXT_INNERKITS_ROOT/netshareclient/include",
60  ]
61
62  external_deps = [
63    "bounds_checking_function:libsec_shared",
64    "netmanager_base:net_conn_manager_if",
65    "netmanager_base:net_manager_common",
66  ]
67
68  external_deps += [ "hilog:libhilog" ]
69
70  part_name = "netmanager_ext"
71  subsystem_name = "communication"
72}
73
74idl_gen_interface("netshare_service_interface") {
75  sources = [ "INetworkShareService.idl" ]
76}
77
78config("netshare_service_interface_stub_config") {
79  include_dirs = [
80    "${target_gen_dir}",
81    "include",
82    "include/proxy",
83    "include/proxy/ipccallback",
84    "$EXT_INNERKITS_ROOT/include",
85  ]
86}
87
88ohos_static_library("netshare_service_interface_stub") {
89  sanitize = {
90    cfi = true
91    cfi_cross_dso = true
92    debug = false
93  }
94  public_configs = [ ":netshare_service_interface_stub_config" ]
95  output_values = get_target_outputs(":netshare_service_interface")
96  sources = []
97  sources += filter_include(output_values, [ "*ice_stub.cpp" ])
98  sources += filter_include(output_values, [ "*ack_proxy.cpp" ])
99  deps = [ ":netshare_service_interface" ]
100  external_deps = [
101    "hilog:libhilog",
102    "ipc:ipc_single",
103    "netmanager_base:net_manager_common",
104    "samgr:samgr_proxy",
105    "c_utils:utils",
106  ]
107  part_name = "netmanager_ext"
108  subsystem_name = "communication"
109}
110
111ohos_shared_library("net_tether_manager_if") {
112  sanitize = {
113    cfi = true
114    cfi_cross_dso = true
115    debug = false
116  }
117
118  branch_protector_ret = "pac_ret"
119
120  include_dirs = [ "$EXT_INNERKITS_ROOT/include"]
121
122  sources = [
123    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/networkshare_client.cpp",
124    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/netshare_result_callback_proxy.cpp",
125    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/netshare_result_callback_stub.cpp",
126    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp",
127    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp",
128  ]
129
130  output_values = get_target_outputs(":netshare_service_interface")
131  sources += filter_include(output_values, [ "*ice_proxy.cpp" ])
132  sources += filter_include(output_values, [ "*ack_stub.cpp" ])
133
134  version_script = "libnetshare_kits.map"
135
136  public_configs = [ ":net_conn_manager_if_config" ]
137
138  deps = [ ":networkshare_parcel" ]
139  deps += [ ":netshare_service_interface" ]
140
141  external_deps = [
142    "c_utils:utils",
143    "ipc:ipc_single",
144    "samgr:samgr_proxy",
145  ]
146
147  public_external_deps = [ "netmanager_base:net_manager_common" ]
148
149  defines = [
150    "NETMGR_LOG_TAG = \"NetworkShareManager\"",
151    "LOG_DOMAIN = 0xD0015B0",
152  ]
153
154  if (enable_netmgr_ext_debug) {
155    defines += [ "NETMGR_DEBUG" ]
156  }
157
158  external_deps += [ "hilog:libhilog" ]
159
160  innerapi_tags = [ "platformsdk" ]
161  part_name = "netmanager_ext"
162  subsystem_name = "communication"
163}
164