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 14declare_args() { 15 ohos_hiviewdfx_hiview_lite_output_option = 1 16 ohos_hiviewdfx_hilog_lite_level = 1 17 ohos_hiviewdfx_hilog_lite_level_release = 3 18 ohos_hiviewdfx_hilog_lite_log_switch = 1 19 ohos_hiviewdfx_dump_lite_dump_switch = 0 20 ohos_hiviewdfx_hievent_lite_event_switch = 1 21 ohos_hiviewdfx_hiview_lite_output_module = -1 22 ohos_hiviewdfx_hiview_lite_dir = "" 23 ohos_hiviewdfx_hiview_lite_stack_size = 4096 24 ohos_hiviewdfx_hiview_lite_customize_implementation = false 25} 26 27config("hiview_lite_config") { 28 defines = [ "HIVIEW_FILE_DIR=\"$ohos_hiviewdfx_hiview_lite_dir\"" ] 29 include_dirs = [ 30 "//base/hiviewdfx/hiview_lite", 31 "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr", 32 "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite", 33 "//base/hiviewdfx/hievent_lite/interfaces/native/innerkits", 34 "//commonlibrary/utils_lite/include", 35 ] 36} 37 38static_library("hiview_lite_static") { 39 sources = [ 40 "hiview_cache.c", 41 "hiview_config.c", 42 "hiview_file.c", 43 "hiview_service.c", 44 "hiview_util.c", 45 ] 46 defines = [ 47 "OUTPUT_OPTION=$ohos_hiviewdfx_hiview_lite_output_option", 48 "HILOG_LITE_SWITCH=$ohos_hiviewdfx_hilog_lite_log_switch", 49 "DUMP_LITE_SWITCH=$ohos_hiviewdfx_dump_lite_dump_switch", 50 "HIEVENT_LITE_SWITCH=$ohos_hiviewdfx_hievent_lite_event_switch", 51 "LOG_OUTPUT_MODULE=$ohos_hiviewdfx_hiview_lite_output_module", 52 "HIVIEW_STACK_SIZE=$ohos_hiviewdfx_hiview_lite_stack_size", 53 ] 54 if (ohos_build_type == "debug") { 55 defines += [ "OUTPUT_LEVEL=$ohos_hiviewdfx_hilog_lite_level" ] 56 } else { 57 defines += [ "OUTPUT_LEVEL=$ohos_hiviewdfx_hilog_lite_level_release" ] 58 } 59 if (board_toolchain_type == "iccarm") { 60 cflags = [ 61 "--diag_suppress", 62 "Pe546", 63 ] 64 } 65 public_configs = [ ":hiview_lite_config" ] 66} 67 68group("hiview_lite") { 69 if (ohos_hiviewdfx_hiview_lite_customize_implementation) { 70 public_configs = [ ":hiview_lite_config" ] 71 } else { 72 public_deps = [ ":hiview_lite_static" ] 73 } 74} 75