1# Copyright (c) 2020-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("//build/lite/config/component/lite_component.gni") 15import("//build/lite/ndk/ndk.gni") 16declare_args() { 17 hilog_lite_disable_privacy_feature = false 18 hilog_lite_disable_hilog_static = false 19} 20 21config("hilog_config") { 22 include_dirs = [ 23 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog", 24 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 25 "//third_party/bounds_checking_function/include", 26 ] 27 if (hilog_lite_disable_privacy_feature) { 28 defines = [ "DISABLE_HILOG_PRIVACY" ] 29 } 30 if (ohos_kernel_type != "liteos_m") { 31 cflags = [ 32 "-Wall", 33 "-fno-common", 34 "-fno-strict-aliasing", 35 "-O2", 36 ] 37 } 38} 39 40if (hilog_lite_disable_hilog_static) { 41 group("hilog_static") { 42 } 43} else { 44 lite_library("hilog_static") { 45 target_type = "static_library" 46 sources = [ 47 "hilog.cpp", 48 "hiview_log.c", 49 ] 50 public_configs = [ ":hilog_config" ] 51 public_deps = [ "//third_party/bounds_checking_function:libsec_static" ] 52 } 53} 54 55if (ohos_kernel_type != "liteos_m") { 56 lite_library("hilog_shared") { 57 target_type = "shared_library" 58 sources = [ 59 "hilog.cpp", 60 "hiview_log.c", 61 ] 62 public_configs = [ ":hilog_config" ] 63 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 64 } 65} else { 66 group("hilog_shared") { 67 } 68} 69 70ndk_lib("hilog_ndk") { 71 lib_extension = ".so" 72 deps = [ ":hilog_shared" ] 73 head_files = [ 74 "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog", 75 "//third_party/bounds_checking_function/include", 76 ] 77} 78