1# Copyright (c) 2021-2022 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. 13base_sources = [ "init_log.c" ] 14 15config("exported_header_files") { 16 visibility = [ ":*" ] 17 include_dirs = [ 18 "//base/startup/init/interfaces/innerkits/include", 19 "//base/startup/init/services/log", 20 "//base/startup/init/services/include", 21 ] 22} 23 24if (defined(ohos_lite)) { 25 static_library("init_log") { 26 sources = base_sources 27 defines = [ 28 "_GNU_SOURCE", 29 "OHOS_LITE", 30 ] 31 public_configs = [ ":exported_header_files" ] 32 33 if (ohos_kernel_type == "linux") { 34 defines += [ "INIT_DMESG" ] 35 } 36 if (ohos_kernel_type == "liteos_m") { 37 defines += [ "__LITEOS_M__" ] 38 } 39 include_dirs = [ 40 "//base/hiviewdfx/hilog_lite/interfaces/native/kits", 41 "//third_party/bounds_checking_function/include", 42 ] 43 } 44} else { 45 import("//build/ohos.gni") 46 ohos_static_library("init_log") { 47 sources = base_sources 48 defines = [ "INIT_DMESG" ] 49 public_configs = [ ":exported_header_files" ] 50 51 include_dirs = [ "//third_party/bounds_checking_function/include" ] 52 part_name = "startup" 53 subsystem_name = "startup" 54 } 55 56 ohos_static_library("agent_log") { 57 sources = base_sources 58 defines = [ "INIT_AGENT" ] 59 public_configs = [ ":exported_header_files" ] 60 include_dirs = [ "//third_party/bounds_checking_function/include" ] 61 external_deps = [ "hilog_native:libhilog_base" ] 62 part_name = "init" 63 subsystem_name = "startup" 64 } 65} 66