• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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_policy_manager_if_config") {
18  # header file path
19  include_dirs = [
20    "$INNERKITS_ROOT/include",
21    "$INNERKITS_ROOT/netpolicyclient/include",
22    "$INNERKITS_ROOT/netpolicyclient/include/proxy",
23    "$INNERKITS_ROOT/netconnclient/include",
24    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
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("net_policy_parcel") {
55  sources =
56      [ "$NETPOLICYMANAGER_INNERKITS_SOURCE_DIR/src/net_quota_policy.cpp" ]
57
58  include_dirs = [
59    "$INNERKITS_ROOT/include",
60    "$INNERKITS_ROOT/netpolicyclient/include",
61    "$INNERKITS_ROOT/netconnclient/include",
62    "$NETMANAGER_BASE_ROOT/utils/log/include",
63  ]
64
65  deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ]
66  sanitize = {
67    cfi = true
68    debug = false
69  }
70  external_deps = [ "c_utils:utils" ]
71  external_deps += [ "hilog:libhilog" ]
72
73  part_name = "netmanager_base"
74  subsystem_name = "communication"
75}
76
77ohos_shared_library("net_policy_manager_if") {
78  sanitize = {
79    cfi = true
80    boundary_sanitize = true
81    all_ubsan = true
82    debug = false
83  }
84
85  include_dirs = [ "$NETMANAGER_BASE_ROOT/utils/log/include" ]
86
87  sources = [
88    "$NETPOLICYMANAGER_INNERKITS_SOURCE_DIR/src/net_policy_client.cpp",
89    "$NETPOLICYMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_policy_callback_stub.cpp",
90    "$NETPOLICYMANAGER_INNERKITS_SOURCE_DIR/src/proxy/net_policy_service_proxy.cpp",
91  ]
92
93  version_script = "libnetpolicy_kits.map"
94
95  public_configs = [ ":net_policy_manager_if_config" ]
96
97  deps = [ ":net_policy_parcel" ]
98
99  external_deps = [
100    "ipc:ipc_single",
101    "samgr:samgr_proxy",
102  ]
103
104  defines = [
105    "NETMGR_LOG_TAG = \"NetPolicyManager\"",
106    "LOG_DOMAIN = 0xD0015B0",
107  ]
108
109  if (enable_netmgr_debug) {
110    defines += [ "NETMGR_DEBUG" ]
111  }
112
113  external_deps += [ "hilog:libhilog" ]
114
115  innerapi_tags = [ "platformsdk" ]
116  part_name = "netmanager_base"
117  subsystem_name = "communication"
118}
119