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_base/netmanager_base_config.gni")
16
17config("net_service_common_config") {
18  # header file path
19  include_dirs = [ "$INNERKITS_ROOT/netconnclient/include/proxy" ]
20
21  cflags = [
22    "-fstack-protector-strong",
23    "-D_FORTIFY_SOURCE=2",
24    "-O2",
25  ]
26
27  cflags_cc = [
28    "-fstack-protector-strong",
29    "-D_FORTIFY_SOURCE=2",
30    "-O2",
31  ]
32}
33
34ohos_shared_library("net_service_common") {
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    boundary_sanitize = true
39    ubsan = true
40    debug = false
41  }
42
43  branch_protector_ret = "pac_ret"
44
45  sources = [
46    "src/broadcast_manager.cpp",
47    "src/net_manager_center.cpp",
48    "src/net_settings.cpp",
49    "src/route_utils.cpp",
50  ]
51
52  include_dirs = [
53    "include",
54    "$NETMANAGER_BASE_ROOT/utils/log/include",
55    "$INNERKITS_ROOT/include",
56    "$INNERKITS_ROOT/netconnclient/include",
57    "$INNERKITS_ROOT/netmanagernative/include",
58    "$INNERKITS_ROOT/netstatsclient/include",
59    "$NETCONNMANAGER_COMMON_DIR/include",
60    "$NETMANAGER_BASE_ROOT/utils/log/include",
61    "$NETSYSCONTROLLER_ROOT_DIR/include",
62    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
63  ]
64
65  public_configs = [ ":net_service_common_config" ]
66
67  deps = [
68    "$INNERKITS_ROOT/netconnclient:net_conn_parcel",
69    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
70  ]
71
72  external_deps = [
73    "ability_base:want",
74    "bounds_checking_function:libsec_shared",
75    "c_utils:utils",
76    "common_event_service:cesfwk_innerkits",
77    "ffrt:libffrt",
78    "ipc:ipc_core",
79  ]
80
81  defines = [
82    "NETMGR_LOG_TAG = \"NetConnManager\"",
83    "LOG_DOMAIN = 0xD0015B0",
84  ]
85
86  if (enable_netmgr_debug) {
87    defines += [ "NETMGR_DEBUG" ]
88  }
89
90  external_deps += [ "hilog:libhilog" ]
91
92  part_name = "netmanager_base"
93  subsystem_name = "communication"
94}
95