• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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
14if (defined(ohos_lite)) {
15  executable("watchdog_service") {
16    sources = [
17      "//base/startup/init/services/log/init_commlog.c",
18      "//base/startup/init/watchdog/init_watchdog.c",
19    ]
20    deps = [
21      "//base/startup/init/services/log:init_log",
22      "//third_party/bounds_checking_function:libsec_static",
23    ]
24    defines = [
25      "_GNU_SOURCE",
26      "OHOS_LITE_WATCHDOG",
27    ]
28    if (ohos_kernel_type == "linux") {
29      defines += [ "LINUX_WATCHDOG" ]
30    }
31  }
32} else {
33  import("//build/ohos.gni")
34  ohos_executable("watchdog_service") {
35    sources = [
36      "//base/startup/init/services/log/init_commlog.c",
37      "init_watchdog.c",
38    ]
39    deps = [
40      "//base/startup/init/services/log:init_log",
41      "//third_party/bounds_checking_function:libsec_shared",
42    ]
43    defines = [ "LINUX_WATCHDOG" ]
44    defines += [ "_GNU_SOURCE" ]
45    install_enable = true
46    part_name = "init"
47    subsystem_name = "startup"
48  }
49}
50
51group("watchdog") {
52  if (defined(ohos_lite)) {
53    if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
54      deps = [ ":watchdog_service" ]
55    } else {
56      deps = []
57    }
58  } else {
59    deps = [ ":watchdog_service" ]
60  }
61}
62