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("mdns_manager_config") { 18 include_dirs = [ 19 "$BASE_INNERKITS_ROOT/include", 20 "$BASE_INNERKITS_ROOT/netconnclient/include", 21 "$BASE_INNERKITS_ROOT/netconnclient/include/proxy", 22 "$EXT_INNERKITS_ROOT/mdnsclient/include", 23 "$EXT_INNERKITS_ROOT/mdnsclient/include/proxy", 24 "$EXT_INNERKITS_ROOT/include", 25 "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", 26 "include", 27 "include/stub", 28 "include/protocol", 29 ] 30} 31 32ohos_shared_library("mdns_manager") { 33 sources = [ 34 "src/mdns_manager.cpp", 35 "src/mdns_service.cpp", 36 "src/net_interface_callback.cpp", 37 "src/protocol/mdns_packet_parser.cpp", 38 "src/protocol/mdns_protocol_impl.cpp", 39 "src/protocol/mdns_socket_listener.cpp", 40 "src/stub/mdns_event_proxy.cpp", 41 "src/stub/mdns_service_stub.cpp", 42 ] 43 44 configs = [ ":mdns_manager_config" ] 45 46 deps = [ 47 "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel", 48 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 49 ] 50 51 cflags = [ 52 "-fvisibility=hidden", 53 "-fdata-sections", 54 "-ffunction-sections", 55 "-Os", 56 ] 57 58 cflags_cc = [ 59 "-fvisibility-inlines-hidden", 60 "-Os", 61 ] 62 63 ldflags = [ 64 "-Wl,--exclude-libs=ALL", 65 "-Wl,--gc-sections", 66 ] 67 68 external_deps = [ 69 "hisysevent:libhisysevent", 70 "ipc:ipc_core", 71 "netmanager_base:net_conn_manager_if", 72 "safwk:system_ability_fwk", 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 sources = [ 93 "src/mdns_manager.cpp", 94 "src/mdns_service.cpp", 95 "src/net_interface_callback.cpp", 96 "src/protocol/mdns_packet_parser.cpp", 97 "src/protocol/mdns_protocol_impl.cpp", 98 "src/protocol/mdns_socket_listener.cpp", 99 "src/stub/mdns_event_proxy.cpp", 100 "src/stub/mdns_service_stub.cpp", 101 ] 102 103 configs = [ ":mdns_manager_config" ] 104 105 deps = [ 106 "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel", 107 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 108 ] 109 110 external_deps = [ 111 "hisysevent:libhisysevent", 112 "ipc:ipc_core", 113 "netmanager_base:net_conn_manager_if", 114 "safwk:system_ability_fwk", 115 ] 116 117 defines = [ 118 "NETMGR_LOG_TAG = \"MDnsManager\"", 119 "LOG_DOMAIN = 0xD0015B0", 120 ] 121 122 if (enable_netmgr_ext_debug) { 123 defines += [ "NETMGR_DEBUG" ] 124 } 125 126 external_deps += [ "hilog:libhilog" ] 127 128 part_name = "netmanager_ext" 129 subsystem_name = "communication" 130} 131