1# Copyright (c) 2022-2023 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/faultloggerd/faultloggerd.gni") 15 16dfx_log_sources = [ "dfx_log.cpp" ] 17 18if (defined(ohos_lite)) { 19 config("dfx_log_config") { 20 visibility = [ ":*" ] 21 include_dirs = [ 22 ".", 23 "$faultloggerd_interfaces_path/common", 24 "$hilog_lite_include_path", 25 ] 26 } 27 28 static_library("dfx_hilog") { 29 sources = dfx_log_sources 30 public_configs = [ ":dfx_log_config" ] 31 deps = [ "$hilog_lite_deps_path" ] 32 } 33 34 static_library("dfx_hilog_dmesg") { 35 sources = dfx_log_sources 36 public_configs = [ ":dfx_log_config" ] 37 defines = [ "DFX_LOG_DMESG" ] 38 deps = [ "$hilog_lite_deps_path" ] 39 } 40 41 static_library("dfx_hilog_base") { 42 sources = dfx_log_sources 43 public_configs = [ ":dfx_log_config" ] 44 defines = [ "DFX_LOG_HILOG_BASE" ] 45 deps = [ "$hilog_lite_deps_path" ] 46 } 47 48 static_library("dfx_hilog_base_dmesg") { 49 sources = dfx_log_sources 50 public_configs = [ ":dfx_log_config" ] 51 defines = [ 52 "DFX_LOG_HILOG_BASE", 53 "DFX_LOG_DMESG", 54 ] 55 deps = [ "$hilog_lite_deps_path" ] 56 } 57} else { 58 config("dfx_log_config") { 59 visibility = [ ":*" ] 60 include_dirs = [ 61 ".", 62 "$faultloggerd_interfaces_path/common", 63 ] 64 } 65 66 ohos_static_library("dfx_hilog") { 67 sources = dfx_log_sources 68 public_configs = [ ":dfx_log_config" ] 69 external_deps = [ 70 "c_utils:utils", 71 "hilog:libhilog", 72 ] 73 part_name = "faultloggerd" 74 subsystem_name = "hiviewdfx" 75 } 76 77 ohos_static_library("dfx_hilog_dmesg") { 78 sources = dfx_log_sources 79 public_configs = [ ":dfx_log_config" ] 80 defines = [ "DFX_LOG_DMESG" ] 81 external_deps = [ 82 "c_utils:utils", 83 "hilog:libhilog", 84 ] 85 part_name = "faultloggerd" 86 subsystem_name = "hiviewdfx" 87 } 88 89 ohos_static_library("dfx_hilog_base") { 90 sources = dfx_log_sources 91 public_configs = [ ":dfx_log_config" ] 92 defines = [ "DFX_LOG_HILOG_BASE" ] 93 external_deps = [ 94 "c_utils:utils", 95 "hilog:libhilog_base", 96 ] 97 part_name = "faultloggerd" 98 subsystem_name = "hiviewdfx" 99 } 100 101 ohos_static_library("dfx_hilog_base_dmesg") { 102 sources = dfx_log_sources 103 public_configs = [ ":dfx_log_config" ] 104 defines = [ 105 "DFX_LOG_HILOG_BASE", 106 "DFX_LOG_DMESG", 107 ] 108 external_deps = [ 109 "c_utils:utils", 110 "hilog:libhilog_base", 111 ] 112 part_name = "faultloggerd" 113 subsystem_name = "hiviewdfx" 114 } 115} 116