2021-05-06 11:09:21 +08:00

117 lines
3.1 KiB
Plaintext

# Copyright (c) 2020 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.
if (defined(ohos_lite)) {
# feature: init
executable("init_lite") {
output_name = "init"
defines = [
"_GNU_SOURCE", #syscall function need this macro definition
"OHOS_LITE",
]
sources = [
"src/init_adapter.c",
"src/init_cmds.c",
"src/init_jobs.c",
"src/init_read_cfg.c",
"src/init_service.c",
"src/init_service_manager.c",
"src/init_signal_handler.c",
"src/main.c",
]
include_dirs = [
"include",
"//third_party/cJSON",
"//third_party/bounds_checking_function/include",
"//base/startup/syspara_lite/interfaces/kits",
]
cflags = [ "-Wall" ]
deps = [
"//base/startup/syspara_lite/frameworks/parameter:parameter",
"//build/lite/config/component/cJSON:cjson_shared",
"//third_party/bounds_checking_function:libsec_shared",
]
ldflags = []
if (ohos_kernel_type == "liteos_a") {
include_dirs += [ "//kernel/liteos_a/syscall" ]
}
if (ohos_kernel_type == "linux") {
defines += [ "NEED_EXEC_RCS_LINUX" ]
ldflags += [
"-lm",
"-lpthread",
]
deps += [
"//third_party/mksh",
"//third_party/toybox",
]
}
}
if (ohos_build_type == "debug") {
group("unittest") {
deps =
[ "//base/startup/init_lite/services/test/unittest/common:unittest" ]
}
}
} else {
import("//build/ohos.gni")
ohos_executable("updaterueventd") {
sources = [
"src/list.c",
"src/uevent.c",
]
include_dirs = [
"include",
"//third_party/bounds_checking_function/include",
]
deps = [ "//third_party/bounds_checking_function:libsec_static" ]
install_enable = true
part_name = "updater"
}
ohos_executable("updaterinit") {
sources = [
"src/device.c",
"src/init_adapter.c",
"src/init_cmds.c",
"src/init_jobs.c",
"src/init_read_cfg.c",
"src/init_service.c",
"src/init_service_manager.c",
"src/init_signal_handler.c",
"src/main.c",
]
include_dirs = [
"include",
"//third_party/cJSON",
"//third_party/bounds_checking_function/include",
]
deps = [
"//third_party/bounds_checking_function:libsec_static",
"//third_party/cJSON:cjson_static",
]
install_enable = true
part_name = "updater"
}
ohos_prebuilt_etc("init.cfg") {
source = "//device/hisilicon/hi3516dv300/updater/init.cfg"
relative_install_dir = "init"
subsystem_name = "updater"
}
}