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_ext/netmanager_ext_config.gni")
16
17config("net_conn_manager_if_config") {
18  include_dirs = [
19    "include",
20    "include/proxy",
21    "include/proxy/ipccallback",
22    "$BASE_INNERKITS_ROOT/include",
23    "$BASE_INNERKITS_ROOT/netconnclient/include",
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 += [
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}
53
54ohos_source_set("networkshare_parcel") {
55  sanitize = {
56    cfi = true
57    cfi_cross_dso = true
58    debug = false
59  }
60
61  branch_protector_ret = "pac_ret"
62
63  sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/network_share_request_parcel.cpp" ]
64
65  include_dirs = [
66    "$BASE_INNERKITS_ROOT/include",
67    "$EXT_INNERKITS_ROOT/include",
68    "$EXT_INNERKITS_ROOT/netshareclient/include",
69    "$NETMANAGER_EXT_ROOT/utils/log/include",
70  ]
71
72  external_deps = [
73    "bounds_checking_function:libsec_shared",
74    "netmanager_base:net_conn_parcel",
75  ]
76
77  external_deps += [ "hilog:libhilog" ]
78
79  part_name = "netmanager_ext"
80  subsystem_name = "communication"
81}
82
83ohos_shared_library("net_tether_manager_if") {
84  sanitize = {
85    cfi = true
86    cfi_cross_dso = true
87    debug = false
88  }
89
90  branch_protector_ret = "pac_ret"
91
92  include_dirs = [ "$NETMANAGER_EXT_ROOT/utils/log/include" ]
93
94  sources = [
95    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/networkshare_client.cpp",
96    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/netshare_result_callback_proxy.cpp",
97    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/netshare_result_callback_stub.cpp",
98    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp",
99    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp",
100    "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/networkshare_service_proxy.cpp",
101  ]
102
103  version_script = "libnetshare_kits.map"
104
105  public_configs = [ ":net_conn_manager_if_config" ]
106
107  deps = [ ":networkshare_parcel" ]
108
109  external_deps = [
110    "c_utils:utils",
111    "ipc:ipc_single",
112    "samgr:samgr_proxy",
113  ]
114
115  defines = [
116    "NETMGR_LOG_TAG = \"NetworkShareManager\"",
117    "LOG_DOMAIN = 0xD0015B0",
118  ]
119
120  if (enable_netmgr_ext_debug) {
121    defines += [ "NETMGR_DEBUG" ]
122  }
123
124  external_deps += [ "hilog:libhilog" ]
125
126  innerapi_tags = [ "platformsdk" ]
127  part_name = "netmanager_ext"
128  subsystem_name = "communication"
129}
130