1# Copyright (c) 2022-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_base/netmanager_base_config.gni") 16 17config("napi_utils_config") { 18 visibility = [ ":napi_utils" ] 19 include_dirs = [ 20 "$INNERKITS_ROOT/include", 21 "$NETMANAGER_BASE_ROOT/utils/common_utils/include", 22 ] 23} 24 25config("napi_utils_public_config") { 26 include_dirs = [ 27 "include", 28 "$INNERKITS_ROOT/include", 29 "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", 30 "$NETMANAGER_BASE_ROOT/utils/common_utils/include", 31 ] 32 33 cflags = common_cflags 34 35 cflags_cc = common_cflags 36 37 if (product_name != "qemu-arm-linux-min") { 38 defines = [ "ENABLE_EMULATOR" ] 39 } 40} 41 42ohos_shared_library("napi_utils") { 43 sources = [ 44 "src/base_context.cpp", 45 "src/event_listener.cpp", 46 "src/event_manager.cpp", 47 "src/module_template.cpp", 48 "src/napi_utils.cpp", 49 "src/hi_app_event_report.cpp", 50 ] 51 52 branch_protector_ret = "pac_ret" 53 54 configs = [ ":napi_utils_config" ] 55 56 public_configs = [ ":napi_utils_public_config" ] 57 58 deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ] 59 60 external_deps = [ 61 "c_utils:utils", 62 "hilog:libhilog", 63 "ipc:ipc_single", 64 "napi:ace_napi", 65 ] 66 67 if (product_name != "qemu-arm-linux-min") { 68 external_deps += [ 69 "hiappevent:hiappevent_innerapi", 70 "time_service:time_client", 71 "ability_runtime:wantagent_innerkits", 72 ] 73 } 74 75 innerapi_tags = [ "platformsdk" ] 76 part_name = "netmanager_base" 77 subsystem_name = "communication" 78} 79