• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ]
23  if (current_os != "ohos") {
24    cflags = [ "-std=c++17" ]
25  }
26}
27
28ohos_static_library("napi_utils") {
29  sources = [
30    "src/base_context.cpp",
31    "src/event_listener.cpp",
32    "src/event_manager.cpp",
33    "src/module_template.cpp",
34    "src/napi_utils.cpp",
35  ]
36
37  public_configs = [ ":napi_utils_public_config" ]
38
39  public_deps = [ "$NETSTACK_DIR/utils:stack_utils_common" ]
40  external_deps = [
41    "c_utils:utils",
42    "hiviewdfx_hilog_native:libhilog",
43    "napi:ace_napi",
44  ]
45}
46
47ohos_static_library("napi_utils_static") {
48  sources = [
49    "src/base_context.cpp",
50    "src/event_listener.cpp",
51    "src/event_manager.cpp",
52    "src/module_template.cpp",
53    "src/napi_utils.cpp",
54  ]
55
56  public_configs = [ ":napi_utils_public_config" ]
57
58  if (current_os == "ohos") {
59    public_deps = [ "$NETSTACK_DIR/utils:stack_utils_common" ]
60    external_deps = [
61      "c_utils:utils",
62      "hiviewdfx_hilog_native:libhilog",
63      "napi:ace_napi",
64    ]
65  } else {
66    public_deps = [
67      "$ARKUI_ROOT/napi:ace_napi",
68      "$THIRD_PARTY_ROOT/bounds_checking_function:libsec_static",
69    ]
70  }
71}
72