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] 31if (defined(ohos_lite)) { 32 static_library("inithook") { 33 defines = [ 34 "_GNU_SOURCE", 35 "OHOS_LITE", 36 ] 37 include_dirs = comm_include 38 sources = [ "param_hook.c" ] 39 public_configs = [ ":inithook_config" ] 40 } 41} else { 42 ohos_source_set("inithook") { 43 defines = [ 44 "_GNU_SOURCE", 45 "PARAM_SUPPORT_TRIGGER", 46 ] 47 include_dirs = comm_include 48 sources = [ 49 "init_hook.c", 50 "param_hook.c", 51 ] 52 if (build_selinux) { 53 include_dirs += [ 54 "//third_party/selinux/libselinux/include/", 55 "//base/security/selinux/interfaces/policycoreutils/include/", 56 ] 57 defines += [ "WITH_SELINUX" ] 58 } 59 public_configs = [ ":inithook_config" ] 60 public_configs += [ "//base/startup/init/interfaces/innerkits/init_module_engine:init_module_engine_exported_config" ] 61 } 62} 63