• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 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("//base/hiviewdfx/hilog/hilog.gni")
15import("//build/ohos.gni")
16
17ohos_source_set("libhilognapi_src") {
18  defines = []
19  include_dirs = [
20    "//third_party/node/src",
21    "//third_party/bounds_checking_function/include",
22    "//base/hiviewdfx/hilog/frameworks/libhilog/param/include",
23    "//base/hiviewdfx/hilog/frameworks/libhilog/include",
24  ]
25  sources = [
26    "src/common/napi/n_class.cpp",
27    "src/common/napi/n_func_arg.cpp",
28    "src/common/napi/n_val.cpp",
29    "src/hilog/module.cpp",
30    "src/hilog/src/hilog_napi.cpp",
31    "src/hilog/src/hilog_napi_base.cpp",
32  ]
33  deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
34  if (is_mingw || is_mac || is_linux) {
35    deps += [ "//foundation/arkui/napi:ace_napi" ]
36  } else {
37    deps += [ "../../../../interfaces/native/innerkits:libhilog" ]
38    external_deps = [ "napi:ace_napi" ]
39  }
40
41  cflags_cc = []
42  if (is_mingw) {
43    deps += [
44      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_windows",
45    ]
46    defines += [ "__WINDOWS__" ]
47    cflags_cc += [ "-std=c++17" ]
48  } else if (is_mac) {
49    deps +=
50        [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_mac" ]
51    defines += [ "__MAC__" ]
52  } else if (is_linux) {
53    deps +=
54        [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_linux" ]
55    defines += [ "__LINUX__" ]
56  }
57  subsystem_name = "hiviewdfx"
58  part_name = "hilog"
59}
60
61config("libhilog_js_cfg") {
62  visibility = [ "*:*" ]
63  include_dirs = [ "include" ]
64}
65
66ohos_shared_library("libhilognapi") {
67  sanitize = {
68    cfi = true
69    cfi_cross_dso = true
70    debug = false
71  }
72  deps = [ ":libhilognapi_src" ]
73
74  public_configs = [ ":libhilog_js_cfg" ]
75  configs = [ ":libhilog_js_cfg" ]
76
77  output_name = "libhilog_napi"
78  relative_install_dir = "module"
79  subsystem_name = "hiviewdfx"
80  part_name = "hilog"
81}
82