1# Copyright (c) 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. 13 14import("//build/ohos.gni") 15 16config("inithook_config") { 17 include_dirs = [ "//base/startup/init/services/modules/init_hook" ] 18} 19comm_include = [ 20 "//base/startup/init/services/include", 21 "//base/startup/init/services/include/param", 22 "//base/startup/init/services/modules", 23 "//base/startup/init/services/modules/init_hook", 24 "//base/startup/init/services/init/include", 25 "//base/startup/init/services/loopevent/include", 26 "//base/startup/init/services/log", 27 "//base/startup/init/interfaces/innerkits/include", 28 "//third_party/cJSON", 29 "//third_party/bounds_checking_function/include", 30 "//base/hiviewdfx/hilog_lite/interfaces/native/kits", 31] 32if (defined(ohos_lite)) { 33 static_library("inithook") { 34 defines = [ 35 "_GNU_SOURCE", 36 "OHOS_LITE", 37 ] 38 include_dirs = comm_include 39 sources = [ "param_hook.c" ] 40 public_configs = [ ":inithook_config" ] 41 } 42} else { 43 ohos_source_set("inithook") { 44 defines = [ 45 "_GNU_SOURCE", 46 "PARAM_SUPPORT_TRIGGER", 47 ] 48 include_dirs = comm_include 49 sources = [ 50 "init_hook.c", 51 "param_hook.c", 52 ] 53 if (build_selinux) { 54 include_dirs += [ 55 "//third_party/selinux/libselinux/include/", 56 "//base/security/selinux_adapter/interfaces/policycoreutils/include/", 57 ] 58 defines += [ "WITH_SELINUX" ] 59 } 60 public_configs = [ ":inithook_config" ] 61 public_configs += [ "//base/startup/init/interfaces/innerkits/init_module_engine:init_module_engine_exported_config" ] 62 } 63} 64