• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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")
15
16SUBSYSTEM_DIR = "//foundation/communication"
17
18utils_source = [
19  "$SUBSYSTEM_DIR/netmanager_base/utils/base_context/src/netmanager_base_base_context.cpp",
20  "$SUBSYSTEM_DIR/netmanager_base/utils/common_utils/src/netmanager_base_common_utils.cpp",
21  "$SUBSYSTEM_DIR/netmanager_base/utils/event_manager/src/netmanager_base_event_listener.cpp",
22  "$SUBSYSTEM_DIR/netmanager_base/utils/event_manager/src/netmanager_base_event_manager.cpp",
23  "$SUBSYSTEM_DIR/netmanager_base/utils/module_template/src/netmanager_base_module_template.cpp",
24  "$SUBSYSTEM_DIR/netmanager_base/utils/napi_utils/src/netmanager_base_napi_utils.cpp",
25]
26
27utils_include = [
28  "$SUBSYSTEM_DIR/netmanager_base/utils/base_async_work/include",
29  "$SUBSYSTEM_DIR/netmanager_base/utils/base_context/include",
30  "$SUBSYSTEM_DIR/netmanager_base/utils/common_utils/include",
31  "$SUBSYSTEM_DIR/netmanager_base/utils/event_manager/include",
32  "$SUBSYSTEM_DIR/netmanager_base/utils/log/include",
33  "$SUBSYSTEM_DIR/netmanager_base/utils/module_template/include",
34  "$SUBSYSTEM_DIR/netmanager_base/utils/napi_utils/include",
35]
36
37common_include = [
38  "//foundation/ace/napi/interfaces/kits",
39  "//foundation/ace/napi",
40  "//third_party/libuv/include",
41  "//third_party/node/src",
42]
43
44common_deps = [
45  "//foundation/ace/napi/:ace_napi",
46  "//foundation/communication/netmanager_base/interfaces/innerkits/netconnclient:net_conn_manager_if",
47  "//third_party/libuv:uv_static",
48  "//utils/native/base:utils",
49]
50
51common_external_deps = [
52  "hiviewdfx_hilog_native:libhilog",
53  "ipc:ipc_core",
54]
55
56common_relative_install_dir = "module"
57common_part_name = "netmanager_base"
58common_subsystem_name = "communication"
59
60ohos_shared_library("network") {
61  include_dirs = [
62    "async_context/include",
63    "async_work/include",
64    "constant/include",
65    "network_exec/include",
66    "network_module/include",
67    "observer/include",
68    "options/include",
69  ]
70  include_dirs += utils_include
71  include_dirs += common_include
72
73  sources = [
74    "async_context/src/gettype_context.cpp",
75    "async_context/src/subscribe_context.cpp",
76    "async_context/src/unsubscribe_context.cpp",
77    "async_work/src/network_async_work.cpp",
78    "network_exec/src/network_exec.cpp",
79    "network_module/src/network_module.cpp",
80    "observer/src/net_conn_callback_observer.cpp",
81    "options/src/netconnection.cpp",
82  ]
83  sources += utils_source
84
85  deps = common_deps
86  if (defined(global_parts_info) &&
87      defined(global_parts_info.telephony_core_service) &&
88      global_parts_info.telephony_core_service) {
89    deps += [
90      "//base/telephony/core_service:tel_core_service",
91      "//base/telephony/core_service/interfaces/innerkits:tel_core_service_api",
92    ]
93    defines = [ "HAS_TELEPHONY=1" ]
94  }
95
96  external_deps = common_external_deps
97
98  relative_install_dir = common_relative_install_dir
99  part_name = common_part_name
100  subsystem_name = common_subsystem_name
101}
102