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/log/include",
30    "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include",
31    "$NETMANAGER_BASE_ROOT/utils/log/include",
32  ]
33
34  cflags = [
35    "-fstack-protector-strong",
36    "-D_FORTIFY_SOURCE=2",
37    "-O2",
38  ]
39
40  cflags_cc = [
41    "-fstack-protector-strong",
42    "-D_FORTIFY_SOURCE=2",
43    "-O2",
44  ]
45}
46
47ohos_shared_library("napi_utils") {
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  configs = [ ":napi_utils_config" ]
57
58  public_configs = [ ":napi_utils_public_config" ]
59
60  deps = [ "$NETMANAGER_BASE_ROOT/utils:net_manager_common" ]
61
62  external_deps = [
63    "c_utils:utils",
64    "hilog:libhilog",
65    "napi:ace_napi",
66  ]
67
68  innerapi_tags = [ "platformsdk" ]
69  part_name = "netmanager_base"
70  subsystem_name = "communication"
71}
72