• 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    external_deps = [
38      "hilog_native:libhilog",
39      "napi:ace_napi",
40    ]
41  }
42
43  cflags_cc = []
44  if (is_mingw) {
45    deps += [
46      "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_windows",
47    ]
48    defines += [ "__WINDOWS__" ]
49    cflags_cc += [ "-std=c++17" ]
50  } else if (is_mac) {
51    deps +=
52        [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_mac" ]
53    defines += [ "__MAC__" ]
54  } else if (is_linux) {
55    deps +=
56        [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_linux" ]
57    defines += [ "__LINUX__" ]
58  }
59  subsystem_name = "hiviewdfx"
60  part_name = "hilog_native"
61}
62
63config("libhilog_js_cfg") {
64  visibility = [ "*:*" ]
65  include_dirs = [ "include" ]
66}
67
68ohos_shared_library("libhilognapi") {
69  deps = [ ":libhilognapi_src" ]
70
71  public_configs = [ ":libhilog_js_cfg" ]
72  configs = [ ":libhilog_js_cfg" ]
73
74  output_name = "libhilog"
75  relative_install_dir = "module"
76  subsystem_name = "hiviewdfx"
77  part_name = "hilog_native"
78}
79