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