• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023 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_mdns_manager_if_config") {
18  # header file path
19  include_dirs = [
20    "$BASE_INNERKITS_ROOT/include",
21    "$EXT_INNERKITS_ROOT/mdnsclient/include",
22    "$EXT_INNERKITS_ROOT/mdnsclient/include/proxy",
23  ]
24
25  cflags = []
26  if (is_double_framework) {
27    cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ]
28  }
29  if (target_cpu == "arm") {
30    cflags += [ "-DBINDER_IPC_32BIT" ]
31  }
32  if (is_standard_system) {
33    cflags += [ "-DCONFIG_STANDARD_SYSTEM" ]
34  }
35  if (defined(build_public_version) && build_public_version) {
36    cflags += [ "-DBUILD_PUBLIC_VERSION" ]
37  }
38
39  cflags += [
40    "-fstack-protector-strong",
41    "-D_FORTIFY_SOURCE=2",
42    "-O2",
43  ]
44
45  cflags_cc = [
46    "-fstack-protector-strong",
47    "-D_FORTIFY_SOURCE=2",
48    "-O2",
49  ]
50}
51
52ohos_source_set("mdns_parcel") {
53  sources = [
54    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_common.cpp",
55    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_service_info.cpp",
56  ]
57
58  include_dirs = [ "$EXT_INNERKITS_ROOT/mdnsclient/include" ]
59
60  deps = [ "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common" ]
61
62  external_deps = [
63    "c_utils:utils",
64    "netmanager_base:net_manager_common",
65  ]
66
67  external_deps += [ "hilog:libhilog" ]
68
69  part_name = "netmanager_ext"
70  subsystem_name = "communication"
71}
72
73ohos_shared_library("mdns_manager_if") {
74  sources = [
75    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_client.cpp",
76    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/mdns_client_resume.cpp",
77    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/proxy/mdns_event_stub.cpp",
78    "$NETMANAGER_EXT_ROOT/frameworks/native/mdnsclient/src/proxy/mdns_service_proxy.cpp",
79  ]
80
81  version_script = "libmdns_kits.map"
82
83  public_configs = [ ":net_mdns_manager_if_config" ]
84
85  deps = [
86    ":mdns_parcel",
87    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
88  ]
89
90  external_deps = [
91    "ipc:ipc_single",
92    "samgr:samgr_proxy",
93  ]
94
95  defines = [
96    "NETMGR_LOG_TAG = \"MDnsManager\"",
97    "LOG_DOMAIN = 0xD0015B0",
98  ]
99
100  if (enable_netmgr_ext_debug) {
101    defines += [ "NETMGR_DEBUG" ]
102  }
103
104  external_deps += [ "hilog:libhilog" ]
105
106  innerapi_tags = [ "platformsdk" ]
107  part_name = "netmanager_ext"
108  subsystem_name = "communication"
109}
110