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 "-fstack-protector-strong", 57 "-D_FORTIFY_SOURCE=2", 58 "-O2", 59 ] 60 61 cflags_cc = [ 62 "-fvisibility-inlines-hidden", 63 "-Os", 64 "-fstack-protector-strong", 65 "-D_FORTIFY_SOURCE=2", 66 "-O2", 67 ] 68 69 ldflags = [ 70 "-Wl,--exclude-libs=ALL", 71 "-Wl,--gc-sections", 72 ] 73 74 external_deps = [ 75 "hisysevent:libhisysevent", 76 "ipc:ipc_core", 77 "netmanager_base:net_conn_manager_if", 78 "safwk:system_ability_fwk", 79 ] 80 81 defines = [ 82 "NETMGR_LOG_TAG = \"MDnsManager\"", 83 "LOG_DOMAIN = 0xD0015B0", 84 ] 85 86 if (enable_netmgr_ext_debug) { 87 defines += [ "NETMGR_DEBUG" ] 88 } 89 90 external_deps += [ "hilog:libhilog" ] 91 92 part_name = "netmanager_ext" 93 subsystem_name = "communication" 94} 95 96ohos_static_library("mdns_manager_static") { 97 testonly = true 98 sources = [ 99 "src/mdns_manager.cpp", 100 "src/mdns_service.cpp", 101 "src/net_interface_callback.cpp", 102 "src/protocol/mdns_packet_parser.cpp", 103 "src/protocol/mdns_protocol_impl.cpp", 104 "src/protocol/mdns_socket_listener.cpp", 105 "src/stub/mdns_event_proxy.cpp", 106 "src/stub/mdns_service_stub.cpp", 107 ] 108 109 configs = [ ":mdns_manager_config" ] 110 111 deps = [ 112 "$EXT_INNERKITS_ROOT/mdnsclient:mdns_parcel", 113 "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", 114 ] 115 116 external_deps = [ 117 "hisysevent:libhisysevent", 118 "ipc:ipc_core", 119 "netmanager_base:net_conn_manager_if", 120 "safwk:system_ability_fwk", 121 ] 122 123 defines = [ 124 "NETMGR_LOG_TAG = \"MDnsManager\"", 125 "LOG_DOMAIN = 0xD0015B0", 126 ] 127 128 if (enable_netmgr_ext_debug) { 129 defines += [ "NETMGR_DEBUG" ] 130 } 131 132 external_deps += [ "hilog:libhilog" ] 133 134 part_name = "netmanager_ext" 135 subsystem_name = "communication" 136} 137