• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023-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("mdns_manager_config") {
18  include_dirs = [
19    "$EXT_INNERKITS_ROOT/mdnsclient/include",
20    "$EXT_INNERKITS_ROOT/mdnsclient/include/proxy",
21    "$EXT_INNERKITS_ROOT/include",
22    "include",
23    "include/stub",
24  ]
25}
26
27ohos_shared_library("mdns_manager") {
28  sanitize = {
29    cfi = true
30    cfi_cross_dso = true
31    debug = false
32  }
33
34  branch_protector_ret = "pac_ret"
35
36  sources = [
37    "$NETMANAGER_EXT_ROOT/frameworks/js/napi/mdns/src/mdns_manager.cpp",
38    "$NETMANAGER_EXT_ROOT/frameworks/js/napi/mdns/src/mdns_socket_listener.cpp",
39    "src/mdns_packet_parser.cpp",
40    "src/mdns_protocol_impl.cpp",
41    "src/mdns_service.cpp",
42    "src/net_interface_callback.cpp",
43
44  ]
45
46  configs = [ ":mdns_manager_config" ]
47
48  include_dirs = [
49    "$EXT_INNERKITS_ROOT/include",
50  ]
51
52  deps = [
53    "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel",
54    "$EXT_INNERKITS_ROOT/mdnsclient:mdns_service_interface_stub",
55  ]
56
57  deps += [ "$EXT_INNERKITS_ROOT/mdnsclient:mdns_service_interface_stub" ]
58  cflags = common_cflags + memory_optimization_cflags
59
60  cflags_cc = common_cflags + memory_optimization_cflags_cc
61
62  ldflags = memory_optimization_ldflags
63
64  external_deps = [
65    "bounds_checking_function:libsec_shared",
66    "common_event_service:cesfwk_innerkits",
67    "hisysevent:libhisysevent",
68    "ipc:ipc_core",
69    "netmanager_base:net_conn_manager_if",
70    "netmanager_base:net_manager_common",
71    "safwk:system_ability_fwk",
72    "samgr:samgr_proxy",
73  ]
74
75  defines = [
76    "NETMGR_LOG_TAG = \"MDnsManager\"",
77    "LOG_DOMAIN = 0xD0015B0",
78  ]
79
80  if (enable_netmgr_ext_debug) {
81    defines += [ "NETMGR_DEBUG" ]
82  }
83
84  external_deps += [ "hilog:libhilog" ]
85
86  part_name = "netmanager_ext"
87  subsystem_name = "communication"
88}
89
90ohos_static_library("mdns_manager_static") {
91  testonly = true
92  sanitize = {
93    cfi = true
94    cfi_cross_dso = true
95    debug = false
96  }
97
98  branch_protector_ret = "pac_ret"
99
100  sources = [
101    "$NETMANAGER_EXT_ROOT/frameworks/js/napi/mdns/src/mdns_manager.cpp",
102    "$NETMANAGER_EXT_ROOT/frameworks/js/napi/mdns/src/mdns_socket_listener.cpp",
103    "src/mdns_packet_parser.cpp",
104    "src/mdns_protocol_impl.cpp",
105    "src/mdns_service.cpp",
106    "src/net_interface_callback.cpp",
107  ]
108
109  configs = [ ":mdns_manager_config" ]
110
111  include_dirs = [
112    "$EXT_INNERKITS_ROOT/include",
113  ]
114
115  deps = [
116    "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel",
117    "$EXT_INNERKITS_ROOT/mdnsclient:mdns_service_interface_stub",
118  ]
119
120  deps += [ "$EXT_INNERKITS_ROOT/mdnsclient:mdns_service_interface_stub" ]
121  external_deps = [
122    "bounds_checking_function:libsec_shared",
123    "common_event_service:cesfwk_innerkits",
124    "hisysevent:libhisysevent",
125    "ipc:ipc_core",
126    "netmanager_base:net_conn_manager_if",
127    "netmanager_base:net_manager_common",
128    "safwk:system_ability_fwk",
129    "samgr:samgr_proxy",
130  ]
131
132  defines = [
133    "NETMGR_LOG_TAG = \"MDnsManager\"",
134    "LOG_DOMAIN = 0xD0015B0",
135  ]
136
137  if (enable_netmgr_ext_debug) {
138    defines += [ "NETMGR_DEBUG" ]
139  }
140
141  external_deps += [ "hilog:libhilog" ]
142
143  part_name = "netmanager_ext"
144  subsystem_name = "communication"
145}
146