• 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("//build/lite/config/component/lite_component.gni")
15declare_args() {
16  ohos_hiviewdfx_hilog_file_size = 1024000
17  enable_ohos_hiviewdfx_apphilogcat_init_release = false
18  enable_ohos_hiviewdfx_apphilogcat_init_debug = true
19  ohos_hiviewdfx_apphilogcat_log_level_release = 5
20  ohos_hiviewdfx_apphilogcat_log_level_debug = 3
21  apphilogcat_on = 1
22  apphilogcat_off = 0
23  enable_ohos_hiviewdfx_hilogcat_build = true
24  ohos_hiviewdfx_apphilogcat_log_dir = "/storage/data/log"
25}
26
27config("apphilogcat_config") {
28  defines = [ "HILOG_MAX_FILELEN = $ohos_hiviewdfx_hilog_file_size" ]
29
30  if (enable_ohos_hiviewdfx_apphilogcat_init_release) {
31    defines += [ "APPHILOGCAT_STATUS_RELEASE = $apphilogcat_on" ]
32  } else {
33    defines += [ "APPHILOGCAT_STATUS_RELEASE = $apphilogcat_off" ]
34  }
35
36  if (enable_ohos_hiviewdfx_apphilogcat_init_debug) {
37    defines += [ "APPHILOGCAT_STATUS_DEBUG = $apphilogcat_on" ]
38  } else {
39    defines += [ "APPHILOGCAT_STATUS_DEBUG = $apphilogcat_off" ]
40  }
41
42  defines += [
43    "CONFIG_LOG_LEVEL_RELEASE = $ohos_hiviewdfx_apphilogcat_log_level_release",
44  ]
45
46  defines +=
47      [ "CONFIG_LOG_LEVEL_DEBUG = $ohos_hiviewdfx_apphilogcat_log_level_debug" ]
48
49  defines += [ "HILOG_DIR = \"$ohos_hiviewdfx_apphilogcat_log_dir\"" ]
50}
51
52static_library("apphilogcat_static") {
53  sources = [ "hiview_applogcat.c" ]
54  include_dirs = [ "//third_party/bounds_checking_function/include" ]
55  deps = [
56    "//base/hiviewdfx/hilog_lite/command:hilog_command_static",
57    "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
58    "//third_party/bounds_checking_function:libsec_shared",
59  ]
60  public_configs = [ ":apphilogcat_config" ]
61
62  if (enable_ohos_hiviewdfx_hilogcat_build) {
63    deps += [ "//base/hiviewdfx/hilog_lite/services/hilogcat:hilogcat" ]
64  }
65}
66
67lite_component("apphilogcat") {
68  target_type = "executable"
69
70  features = [ ":apphilogcat_static" ]
71}
72