# Copyright (c) 2021-2022 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)) { executable("watchdog_service") { sources = [ "//base/startup/init/services/log/init_commlog.c", "//base/startup/init/watchdog/init_watchdog.c", ] deps = [ "//base/startup/init/services/log:init_log", "//third_party/bounds_checking_function:libsec_static", ] defines = [ "_GNU_SOURCE", "OHOS_LITE_WATCHDOG", ] if (ohos_kernel_type == "linux") { defines += [ "LINUX_WATCHDOG" ] } } } else { import("//build/ohos.gni") ohos_executable("watchdog_service") { sources = [ "init_watchdog.c" ] deps = [ "//base/startup/init/services/log:init_log", "//third_party/bounds_checking_function:libsec_shared", ] if (use_musl == false) { deps += [ "//base/startup/init/services/param/base:parameterbase" ] } else { deps += [ "//base/startup/init/services/param/base:parameterbase_ext" ] } defines = [ "LINUX_WATCHDOG" ] defines += [ "_GNU_SOURCE" ] install_enable = true part_name = "init" } } group("watchdog") { if (defined(ohos_lite)) { if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") { deps = [ ":watchdog_service" ] } else { deps = [] } } else { deps = [ ":watchdog_service" ] } }