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