# Copyright (C) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") NETMANAGER_EXT_NAPI_ROOT = "$NETMANAGER_EXT_ROOT/frameworks/js/napi/" config("mdns_config") { visibility = [ ":mdns" ] cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] } ohos_shared_library("mdns") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" include_dirs = [ "$NETMANAGER_EXT_NAPI_ROOT/mdns/include", "$NETMANAGER_EXT_NAPI_ROOT/mdns/include/contexts", ] sources = [ "src/contexts/mdns_addlocalservice_context.cpp", "src/contexts/mdns_base_context.cpp", "src/contexts/mdns_removelocalservice_context.cpp", "src/contexts/mdns_resolvelocalservice_context.cpp", "src/contexts/mdns_startsearching_context.cpp", "src/mdns_async_work.cpp", "src/mdns_callback_observer.cpp", "src/mdns_exec.cpp", "src/mdns_instances.cpp", "src/mdns_module.cpp", ] defines = [ "NETMGR_DEBUG" ] deps = [ "$EXT_INNERKITS_ROOT/mdnsclient:mdns_manager_if", "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "netmanager_base:napi_utils", "netmanager_base:net_manager_common", ] configs = [ ":mdns_config" ] relative_install_dir = "module/net" part_name = "netmanager_ext" subsystem_name = "communication" }