1# Copyright (c) 2022 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/netstack/netstack_config.gni") 16 17config("napi_utils_public_config") { 18 include_dirs = [ 19 "include", 20 "$THIRD_PARTY_ROOT/node/src", 21 "$NETSTACK_DIR/utils/log/include", 22 "$NETSTACK_DIR/frameworks/js/napi/http/http_module/include", 23 ] 24 if (current_os != "ohos") { 25 cflags = [ "-std=c++17" ] 26 } 27} 28 29ohos_static_library("napi_utils") { 30 sources = [ 31 "src/base_context.cpp", 32 "src/event_listener.cpp", 33 "src/event_manager.cpp", 34 "src/module_template.cpp", 35 "src/napi_utils.cpp", 36 "src/secure_char.cpp", 37 "src/timing.cpp", 38 ] 39 40 part_name = "netstack" 41 subsystem_name = "communication" 42 public_configs = [ ":napi_utils_public_config" ] 43 44 deps = [ "$THIRD_PARTY_ROOT/jsoncpp:jsoncpp" ] 45 46 public_deps = [ "$NETSTACK_DIR/utils:stack_utils_common" ] 47 external_deps = [ 48 "c_utils:utils", 49 "hilog:libhilog", 50 "napi:ace_napi", 51 ] 52} 53 54ohos_static_library("napi_utils_static") { 55 sources = [ 56 "src/base_context.cpp", 57 "src/event_listener.cpp", 58 "src/event_manager.cpp", 59 "src/module_template.cpp", 60 "src/napi_utils.cpp", 61 "src/secure_char.cpp", 62 "src/timing.cpp", 63 ] 64 65 public_configs = [ ":napi_utils_public_config" ] 66 67 deps = [ "$THIRD_PARTY_ROOT/jsoncpp:jsoncpp" ] 68 69 if (current_os == "ohos") { 70 public_deps = [ "$NETSTACK_DIR/utils:stack_utils_common" ] 71 external_deps = [ 72 "c_utils:utils", 73 "hilog:libhilog", 74 "napi:ace_napi", 75 ] 76 } else { 77 public_deps = [ 78 "$ARKUI_ROOT/napi:ace_napi", 79 "$THIRD_PARTY_ROOT/bounds_checking_function:libsec_static", 80 ] 81 } 82} 83