• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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")
16config("netsys_controller_include") {
17  include_dirs = [
18    "include",
19    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
20    "$INNERKITS_ROOT/netstatsclient/include",
21  ]
22
23  cflags = [
24    "-fstack-protector-strong",
25    "-D_FORTIFY_SOURCE=2",
26    "-O2",
27  ]
28
29  cflags_cc = [
30    "-fstack-protector-strong",
31    "-D_FORTIFY_SOURCE=2",
32    "-O2",
33  ]
34}
35
36ohos_shared_library("netsys_controller") {
37  sanitize = {
38    cfi = true
39    cfi_cross_dso = true
40    boundary_sanitize = true
41    ubsan = true
42    debug = false
43  }
44
45  branch_protector_ret = "pac_ret"
46
47  public_configs = [ ":netsys_controller_include" ]
48  sources = [
49    "src/mock_netsys_native_client.cpp",
50    "src/netsys_controller.cpp",
51    "src/netsys_controller_service_impl.cpp",
52    "src/netsys_native_client.cpp",
53  ]
54
55  include_dirs = [
56    "include",
57    "$NETCONNMANAGER_SOURCE_DIR/include",
58    "$NETCONNMANAGER_COMMON_DIR/include",
59    "$NETMANAGER_BASE_ROOT/utils/log/include",
60    "$NETSYSNATIVE_INNERKITS_SOURCE_DIR",
61    "$INNERKITS_ROOT/netmanagernative/include",
62    "$INNERKITS_ROOT/netconnclient/include",
63    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
64    "$NETSYSNATIVE_SOURCE_DIR/include/manager",
65  ]
66
67  deps = [
68    "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager",
69    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
70  ]
71
72  external_deps = [
73    "c_utils:utils",
74    "ipc:ipc_core",
75    "samgr:samgr_proxy",
76  ]
77
78  defines = [
79    "NETMGR_LOG_TAG = \"NetConnManager\"",
80    "LOG_DOMAIN = 0xD0015B0",
81  ]
82
83  if (enable_netmgr_debug) {
84    defines += [ "NETMGR_DEBUG" ]
85  }
86
87  if (enable_sys_func) {
88    defines += [ "SYS_FUNC" ]
89  }
90
91  if (netmanager_base_enable_feature_net_firewall) {
92    defines += [ "FEATURE_NET_FIREWALL_ENABLE" ]
93  }
94
95  external_deps += [ "hilog:libhilog" ]
96
97  innerapi_tags = [ "platformsdk_indirect" ]
98  part_name = "netmanager_base"
99  subsystem_name = "communication"
100}
101