startup_init/services/param/BUILD.gn
2022-01-29 07:54:39 +00:00

121 lines
3.5 KiB
Plaintext
Executable File

# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/init_lite/begetd.gni")
import("//build/ohos.gni")
declare_args() {
param_security = "dac"
}
ohos_static_library("param_service") {
sources = [
"adapter/param_libuvadp.c",
"adapter/param_persistadp.c",
"manager/param_manager.c",
"manager/param_message.c",
"manager/param_trie.c",
"manager/param_utils.c",
"service/param_persist.c",
"service/param_service.c",
"trigger/trigger_checker.c",
"trigger/trigger_manager.c",
"trigger/trigger_processor.c",
]
include_dirs = [
"include",
"adapter",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/init/include",
"//base/startup/init_lite/services/log",
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/startup/init_lite/services/loopevent/include",
"//third_party/libuv/include",
"//third_party/cJSON",
]
defines = [ "PARAM_SUPPORT_SAVE_PERSIST" ]
if (defined(boot_kernel_extended_cmdline)) {
defines += [ "BOOT_EXTENDED_CMDLINE=\"${boot_kernel_extended_cmdline}\"" ]
}
if (param_security == "selinux") {
sources += [ "adapter/param_selinux.c" ]
defines += [ "PARAM_SUPPORT_SELINUX" ]
} else {
sources += [ "adapter/param_dac.c" ]
defines += [ "PARAM_SUPPORT_DAC" ]
if (use_musl) {
defines += [ "PARAM_SUPPORT_DAC_CHECK" ]
}
}
deps = [
"//base/startup/init_lite/services/log:init_log",
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/bounds_checking_function:libsec_static",
]
part_name = "init"
subsystem_name = "startup"
}
ohos_shared_library("param_client") {
sources = [
"//base/startup/init_lite/services/utils/init_utils.c",
"client/param_request.c",
"manager/param_manager.c",
"manager/param_message.c",
"manager/param_trie.c",
"manager/param_utils.c",
]
include_dirs = [
"include",
"//base/startup/init_lite/services/include/param",
"//base/startup/init_lite/services/include",
"//base/startup/init_lite/services/log",
"//base/startup/init_lite/interfaces/innerkits/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
"//base/startup/init_lite/services/loopevent/include",
]
defines = [ "INIT_AGENT" ]
defines += [ "_GNU_SOURCE" ]
if (param_security == "selinux") {
sources += [ "adapter/param_selinux.c" ]
defines += [ "PARAM_SUPPORT_SELINUX" ]
} else {
sources += [ "adapter/param_dac.c" ]
defines += [ "PARAM_SUPPORT_DAC" ]
if (use_musl) {
defines += [ "PARAM_SUPPORT_DAC_CHECK" ]
}
}
deps = [
"//base/startup/init_lite/services/log:agent_log",
"//third_party/bounds_checking_function:libsec_static",
]
install_images = [
"system",
"updater",
]
part_name = "init"
}