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. 13import("//base/startup/init/begetd.gni") 14config("exported_header_files") { 15 visibility = [ ":*" ] 16 include_dirs = [ 17 "//base/startup/init/interfaces/innerkits/include", 18 "//base/startup/init/services/log", 19 ] 20} 21 22if (defined(ohos_lite)) { 23 static_library("libinit_utils") { 24 if (board_toolchain_type == "clang") { 25 cflags = [ "-Wno-error=unused-but-set-variable" ] 26 } 27 sources = [ "init_utils.c" ] 28 public_configs = [ ":exported_header_files" ] 29 include_dirs = [ 30 "//base/hiviewdfx/hilog_lite/interfaces/native/kits", 31 "//base/startup/init/interfaces/innerkits/include", 32 ] 33 defines = [ 34 "_GNU_SOURCE", 35 "OHOS_LITE", 36 ] 37 external_deps = [ "bounds_checking_function:libsec_static" ] 38 if (init_lite_no_log) { 39 defines += [ "INIT_NO_LOG" ] 40 } 41 } 42} else { 43 import("//build/ohos.gni") 44 ohos_static_library("libinit_utils") { 45 sources = [ "init_utils.c" ] 46 public_configs = [ ":exported_header_files" ] 47 include_dirs = [ "//base/startup/init/interfaces/innerkits/include" ] 48 external_deps = [ "bounds_checking_function:libsec_static" ] 49 defines = [ "_GNU_SOURCE" ] 50 part_name = "init" 51 subsystem_name = "startup" 52 } 53} 54