BUILD.gn 4.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# 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.

X
xionglei6 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
if (defined(ohos_lite)) {
  static_library("libbegetutil") {
    sources = [ "//base/startup/init_lite/services/log/init_log.c" ]
    defines = [
      "_GNU_SOURCE",
      "OHOS_LITE",
      "INIT_LOG_INIT=3",
    ]
    include_dirs = [
      "./include",
      "//third_party/bounds_checking_function/include",
      "//base/startup/init_lite/services/include",
      "//base/startup/init_lite/services/include/param",
      "//base/startup/init_lite/interfaces/innerkits/fd_holder",
    ]
    deps = [
      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
      "//base/startup/init_lite/services/loopevent:loopevent",
      "//base/startup/init_lite/services/utils:libinit_tools",
      "//third_party/bounds_checking_function:libsec_static",
    ]
  }
} else {
  import("//base/startup/init_lite/begetd.gni")
  import("//build/ohos.gni")
39

X
xionglei6 已提交
40 41 42 43
  config("exported_header_files") {
    visibility = [ ":*" ]
    include_dirs = [ "include/" ]
  }
44

X
xionglei6 已提交
45 46 47
  fs_manager_sources = [
    "fs_manager/fstab.c",
    "fs_manager/fstab_mount.c",
48
  ]
X
xionglei6 已提交
49

X
xionglei6 已提交
50 51 52 53 54 55 56 57 58 59 60 61 62
  ohos_shared_library("libbegetutil") {
    sources = [
      "//base/startup/init_lite/services/log/init_log.c",
      "fd_holder/fd_holder.c",
      "fd_holder/fd_holder_internal.c",
      "file/init_file.c",
      "reboot/init_reboot_innerkits.c",
      "service_control/service_control.c",
      "socket/init_socket.c",
      "syscap/init_syscap.c",
    ]
    sources += fs_manager_sources
    defines = [ "INIT_AGENT" ]
X
xionglei6 已提交
63

X
xionglei6 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77
    include_dirs = [
      "./include",
      "//third_party/bounds_checking_function/include",
      "//base/startup/init_lite/services/include",
      "//base/startup/init_lite/services/include/param",
      "//base/startup/init_lite/interfaces/innerkits/fd_holder",
    ]
    deps = [
      "//base/startup/init_lite/services/loopevent:loopevent",
      "//base/startup/init_lite/services/param:param_client",
      "//base/startup/init_lite/services/utils:libinit_tools",
      "//base/startup/init_lite/services/utils:libinit_utils",
      "//third_party/bounds_checking_function:libsec_shared",
    ]
T
taiyipei 已提交
78 79 80 81
    external_deps = [
      "hilog_native:libhilog_base",
      "utils_base:utils",
    ]
X
xionglei6 已提交
82 83 84 85 86 87 88
    public_configs = [ ":exported_header_files" ]
    part_name = "init"
    install_images = [
      "system",
      "updater",
    ]
  }
89

X
xionglei6 已提交
90 91 92 93 94 95 96 97
  # watcher lib must separate compilation avoid interdependence.
  ohos_shared_library("libbeget_proxy") {
    sources = [
      "//base/startup/init_lite/device_info/device_info_kits.cpp",
      "//base/startup/init_lite/device_info/device_info_proxy.cpp",
      "//base/startup/init_lite/services/log/init_log.c",
      "service_watcher/service_watcher.c",
    ]
X
xionglei6 已提交
98

X
xionglei6 已提交
99 100 101 102 103 104 105 106
    include_dirs = [
      "./include",
      "//base/startup/init_lite/device_info",
      "//base/startup/init_lite/interfaces/innerkits/include",
      "//base/startup/init_lite/services/include",
      "//base/startup/init_lite/services/include/param",
      "//third_party/bounds_checking_function/include",
    ]
107

X
xionglei6 已提交
108 109 110 111 112 113 114 115 116 117 118 119
    defines = [ "INIT_AGENT" ]
    deps = [
      "//base/startup/init_lite/services/param/watcher:param_watcheragent",
      "//base/startup/init_lite/services/utils:libinit_utils",
      "//third_party/bounds_checking_function:libsec_shared",
    ]

    external_deps = [
      "hilog_native:libhilog_base",
      "ipc:ipc_core",
      "safwk:system_ability_fwk",
      "samgr_standard:samgr_proxy",
T
taiyipei 已提交
120
      "utils_base:utils",
X
xionglei6 已提交
121 122 123 124 125 126 127 128 129 130 131 132 133 134
    ]
    part_name = "init"
    install_images = [ "system" ]
  }

  # For init only
  ohos_static_library("libfsmanager_static") {
    sources = fs_manager_sources
    include_dirs = [
      "//base/startup/init_lite/interfaces/innerkits/include",
      "//third_party/bounds_checking_function/include",
      "//base/startup/init_lite/services/log",
      "//base/startup/init_lite/services/include",
    ]
X
fix log  
xionglei6 已提交
135

X
xionglei6 已提交
136 137
    part_name = "init"
  }
138
}