• 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_ext/netmanager_ext_config.gni")
16
17config("net_conn_manager_if_config") {
18  # header file path
19  include_dirs = [
20    "include",
21    "include/proxy",
22    "$EXT_INNERKITS_ROOT/include",
23  ]
24
25  cflags = []
26  if (is_double_framework) {
27    cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ]
28  }
29  if (target_cpu == "arm") {
30    cflags += [ "-DBINDER_IPC_32BIT" ]
31  }
32  if (is_standard_system) {
33    cflags += [ "-DCONFIG_STANDARD_SYSTEM" ]
34  }
35  if (defined(build_public_version) && build_public_version) {
36    cflags += [ "-DBUILD_PUBLIC_VERSION" ]
37  }
38
39  cflags += [
40    "-fstack-protector-strong",
41    "-D_FORTIFY_SOURCE=2",
42    "-O2",
43  ]
44
45  cflags_cc = [
46    "-fstack-protector-strong",
47    "-D_FORTIFY_SOURCE=2",
48    "-O2",
49  ]
50}
51
52ohos_source_set("ethernet_parcel") {
53  sanitize = {
54    cfi = true
55    cfi_cross_dso = true
56    debug = false
57  }
58
59  branch_protector_ret = "pac_ret"
60
61  sources = [
62    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/interface_configuration.cpp",
63    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/mac_address_info.cpp",
64    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/static_configuration.cpp",
65    "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/http_proxy.cpp",
66    "$NETCONNMANAGER_INNERKITS_SOURCE_DIR/src/inet_addr.cpp",
67  ]
68
69  include_dirs = [
70    "$EXT_INNERKITS_ROOT/include",
71    "$EXT_INNERKITS_ROOT/ethernetclient/include",
72    "$NETMANAGER_EXT_ROOT/utils/log/include",
73  ]
74
75  external_deps = [
76    "c_utils:utils",
77    "netmanager_base:net_manager_common",
78  ]
79
80  external_deps += [ "hilog:libhilog" ]
81
82  part_name = "netmanager_ext"
83  subsystem_name = "communication"
84}
85
86ohos_shared_library("ethernet_manager_if") {
87  sanitize = {
88    cfi = true
89    cfi_cross_dso = true
90    debug = false
91  }
92
93  branch_protector_ret = "pac_ret"
94
95  include_dirs = [ "$NETMANAGER_EXT_ROOT/utils/log/include" ]
96
97  sources = [
98    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/ethernet_client.cpp",
99    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ethernet_service_proxy.cpp",
100    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_proxy.cpp",
101    "$ETHERNETMANAGER_INNERKITS_SOURCE_DIR/src/proxy/interface_state_callback_stub.cpp",
102  ]
103
104  version_script = "libethernet_kits.map"
105
106  public_configs = [ ":net_conn_manager_if_config" ]
107
108  deps = [ ":ethernet_parcel" ]
109
110  external_deps = [
111    "bounds_checking_function:libsec_shared",
112    "ipc:ipc_single",
113    "netmanager_base:net_manager_common",
114    "samgr:samgr_proxy",
115  ]
116
117  public_external_deps = [
118    "netmanager_base:net_manager_common",
119    "netmanager_base:net_native_manager_if",
120  ]
121
122  defines = [
123    "NETMGR_LOG_TAG = \"EthernetManager\"",
124    "LOG_DOMAIN = 0xD0015B0",
125  ]
126
127  if (enable_netmgr_ext_debug) {
128    defines += [ "NETMGR_DEBUG" ]
129  }
130
131  external_deps += [ "hilog:libhilog" ]
132
133  innerapi_tags = [ "platformsdk" ]
134  part_name = "netmanager_ext"
135  subsystem_name = "communication"
136}
137