• 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    "src/mdns_manager.cpp",
38    "src/mdns_packet_parser.cpp",
39    "src/mdns_protocol_impl.cpp",
40    "src/mdns_service.cpp",
41    "src/mdns_socket_listener.cpp",
42    "src/net_interface_callback.cpp",
43    "src/stub/mdns_event_proxy.cpp",
44    "src/stub/mdns_service_stub.cpp",
45  ]
46
47  configs = [ ":mdns_manager_config" ]
48
49  deps = [
50    "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel",
51    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
52  ]
53
54  cflags = [
55    "-fvisibility=hidden",
56    "-fdata-sections",
57    "-ffunction-sections",
58    "-Os",
59    "-fstack-protector-strong",
60    "-D_FORTIFY_SOURCE=2",
61    "-O2",
62  ]
63
64  cflags_cc = [
65    "-fvisibility-inlines-hidden",
66    "-Os",
67    "-fstack-protector-strong",
68    "-D_FORTIFY_SOURCE=2",
69    "-O2",
70  ]
71
72  ldflags = [
73    "-Wl,--exclude-libs=ALL",
74    "-Wl,--gc-sections",
75  ]
76
77  external_deps = [
78    "bounds_checking_function:libsec_shared",
79    "hisysevent:libhisysevent",
80    "ipc:ipc_core",
81    "netmanager_base:net_conn_manager_if",
82    "netmanager_base:net_manager_common",
83    "safwk:system_ability_fwk",
84    "samgr:samgr_proxy",
85  ]
86
87  defines = [
88    "NETMGR_LOG_TAG = \"MDnsManager\"",
89    "LOG_DOMAIN = 0xD0015B0",
90  ]
91
92  if (enable_netmgr_ext_debug) {
93    defines += [ "NETMGR_DEBUG" ]
94  }
95
96  external_deps += [ "hilog:libhilog" ]
97
98  part_name = "netmanager_ext"
99  subsystem_name = "communication"
100}
101
102ohos_static_library("mdns_manager_static") {
103  testonly = true
104  sanitize = {
105    cfi = true
106    cfi_cross_dso = true
107    debug = false
108  }
109
110  branch_protector_ret = "pac_ret"
111
112  sources = [
113    "src/mdns_manager.cpp",
114    "src/mdns_packet_parser.cpp",
115    "src/mdns_protocol_impl.cpp",
116    "src/mdns_service.cpp",
117    "src/mdns_socket_listener.cpp",
118    "src/net_interface_callback.cpp",
119    "src/stub/mdns_event_proxy.cpp",
120    "src/stub/mdns_service_stub.cpp",
121  ]
122
123  configs = [ ":mdns_manager_config" ]
124
125  deps = [
126    "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel",
127    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
128  ]
129
130  external_deps = [
131    "bounds_checking_function:libsec_shared",
132    "hisysevent:libhisysevent",
133    "ipc:ipc_core",
134    "netmanager_base:net_conn_manager_if",
135    "netmanager_base:net_manager_common",
136    "safwk:system_ability_fwk",
137    "samgr:samgr_proxy",
138  ]
139
140  defines = [
141    "NETMGR_LOG_TAG = \"MDnsManager\"",
142    "LOG_DOMAIN = 0xD0015B0",
143  ]
144
145  if (enable_netmgr_ext_debug) {
146    defines += [ "NETMGR_DEBUG" ]
147  }
148
149  external_deps += [ "hilog:libhilog" ]
150
151  part_name = "netmanager_ext"
152  subsystem_name = "communication"
153}
154