• 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/config/components/idl_tool/idl.gni")
15import("//build/ohos.gni")
16import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni")
17
18config("net_mdns_manager_if_config") {
19  # header file path
20  include_dirs = [
21    "${target_gen_dir}",
22    "$EXT_INNERKITS_ROOT/mdnsclient/include",
23    "$EXT_INNERKITS_ROOT/mdnsclient/include/proxy",
24  ]
25
26  cflags = []
27  if (is_double_framework) {
28    cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ]
29  }
30  if (target_cpu == "arm") {
31    cflags += [ "-DBINDER_IPC_32BIT" ]
32  }
33  if (is_standard_system) {
34    cflags += [ "-DCONFIG_STANDARD_SYSTEM" ]
35  }
36  if (defined(build_public_version) && build_public_version) {
37    cflags += [ "-DBUILD_PUBLIC_VERSION" ]
38  }
39
40  cflags += common_cflags
41
42  cflags_cc = common_cflags
43}
44
45ohos_static_library("mdns_parcel") {
46  sanitize = {
47    cfi = true
48    cfi_cross_dso = true
49    debug = false
50  }
51
52  branch_protector_ret = "pac_ret"
53
54  sources = [
55    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_common.cpp",
56    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_service_info.cpp",
57  ]
58
59  include_dirs = [  "$EXT_INNERKITS_ROOT/mdnsclient/include" ,
60                    "$EXT_INNERKITS_ROOT/include",
61  ]
62
63  external_deps = [
64    "c_utils:utils",
65    "netmanager_base:net_manager_common",
66  ]
67
68  external_deps += [ "hilog:libhilog" ]
69
70  part_name = "netmanager_ext"
71  subsystem_name = "communication"
72}
73
74idl_gen_interface("mdns_service_interface") {
75  sources = [ "IMdnsService.idl" ]
76  sources_callback = [
77    "IDiscoveryCallback.idl",
78    "IRegistrationCallback.idl",
79    "IResolveCallback.idl",
80  ]
81}
82
83config("mdns_service_interface_stub_config") {
84  include_dirs = [
85    "include",
86    "${target_gen_dir}",
87  ]
88}
89
90ohos_static_library("mdns_service_interface_stub") {
91  sanitize = {
92    cfi = true
93    cfi_cross_dso = true
94    debug = false
95  }
96  public_configs = [ ":mdns_service_interface_stub_config" ]
97  output_values = get_target_outputs(":mdns_service_interface")
98  sources = []
99  sources += filter_include(output_values, [ "*ice_stub.cpp" ])
100  sources += filter_include(output_values, [ "*ack_proxy.cpp" ])
101  deps = [ ":mdns_service_interface" ]
102  external_deps = [
103    "hilog:libhilog",
104    "ipc:ipc_single",
105    "netmanager_base:net_manager_common",
106    "samgr:samgr_proxy",
107    "c_utils:utils",
108  ]
109  part_name = "netmanager_ext"
110  subsystem_name = "communication"
111}
112
113ohos_shared_library("mdns_manager_if") {
114  sanitize = {
115    cfi = true
116    cfi_cross_dso = true
117    debug = false
118  }
119
120  branch_protector_ret = "pac_ret"
121
122  include_dirs = [
123    "$EXT_INNERKITS_ROOT/include",
124  ]
125
126  sources = [
127    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_client.cpp",
128    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_client_resume.cpp",
129  ]
130
131  output_values = get_target_outputs(":mdns_service_interface")
132  sources += filter_include(output_values, [ "*ice_proxy.cpp" ])
133  sources += filter_include(output_values, [ "*ack_stub.cpp" ])
134
135  version_script = "libmdns_kits.map"
136
137  public_configs = [ ":net_mdns_manager_if_config" ]
138
139  deps = [
140    ":mdns_parcel",
141  ]
142
143  deps += [ ":mdns_service_interface" ]
144
145  external_deps = [
146    "bounds_checking_function:libsec_shared",
147    "ipc:ipc_single",
148    "samgr:samgr_proxy",
149  ]
150
151  public_external_deps = [ "netmanager_base:net_manager_common" ]
152
153  defines = [
154    "NETMGR_LOG_TAG = \"MDnsManager\"",
155    "LOG_DOMAIN = 0xD0015B0",
156  ]
157
158  if (enable_netmgr_ext_debug) {
159    defines += [ "NETMGR_DEBUG" ]
160  }
161
162  external_deps += [ "hilog:libhilog" ]
163
164  innerapi_tags = [ "platformsdk" ]
165  part_name = "netmanager_ext"
166  subsystem_name = "communication"
167}
168