• 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  deps = [ "$THIRD_PARTY_ROOT/jsoncpp:jsoncpp" ]
40
41  public_deps = [ "$NETSTACK_DIR/utils:stack_utils_common" ]
42  external_deps = [
43    "c_utils:utils",
44    "hiviewdfx_hilog_native:libhilog",
45    "napi:ace_napi",
46  ]
47}
48
49ohos_static_library("napi_utils_static") {
50  sources = [
51    "src/base_context.cpp",
52    "src/event_listener.cpp",
53    "src/event_manager.cpp",
54    "src/module_template.cpp",
55    "src/napi_utils.cpp",
56  ]
57
58  public_configs = [ ":napi_utils_public_config" ]
59
60  deps = [ "$THIRD_PARTY_ROOT/jsoncpp:jsoncpp" ]
61
62  if (current_os == "ohos") {
63    public_deps = [ "$NETSTACK_DIR/utils:stack_utils_common" ]
64    external_deps = [
65      "c_utils:utils",
66      "hiviewdfx_hilog_native:libhilog",
67      "napi:ace_napi",
68    ]
69  } else {
70    public_deps = [
71      "$ARKUI_ROOT/napi:ace_napi",
72      "$THIRD_PARTY_ROOT/bounds_checking_function:libsec_static",
73    ]
74  }
75}
76