You need to sign in or sign up before continuing.
BUILD.gn 5.8 KB
Newer Older
Z
zhong_ning 已提交
1
# Copyright (c) 2021 Huawei Device Co., Ltd.
Z
zhong_ning 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14
# 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("//build/ohos.gni")

S
sun_fan 已提交
15 16
declare_args() {
  param_security = "dac"
17
  param_test = "false"
S
sun_fan 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30
}

ohos_prebuilt_etc("param_watcher.rc") {
  if (use_musl) {
    source = "watcher/etc/param_watcher.cfg"
  } else {
    source = "watcher/etc/param_watcher.rc"
  }
  relative_install_dir = "init"
  part_name = "init"
}

ohos_static_library("param_service") {
Z
zhong_ning 已提交
31
  sources = [
32 33
    "//base/startup/init_lite/services/utils/init_utils.c",
    "//base/startup/init_lite/services/utils/list.c",
S
sun_fan 已提交
34 35
    "adapter/param_libuvadp.c",
    "adapter/param_persistadp.c",
Z
zhong_ning 已提交
36
    "manager/param_manager.c",
S
sun_fan 已提交
37
    "manager/param_message.c",
Z
zhong_ning 已提交
38
    "manager/param_trie.c",
S
sun_fan 已提交
39
    "manager/param_utils.c",
Z
zhong_ning 已提交
40 41 42 43 44 45 46 47 48
    "service/param_persist.c",
    "service/param_service.c",
    "trigger/trigger_checker.c",
    "trigger/trigger_manager.c",
    "trigger/trigger_processor.c",
  ]

  include_dirs = [
    "include",
S
sun_fan 已提交
49
    "adapter",
Z
zhong_ning 已提交
50 51
    "//base/startup/init_lite/services/include/param",
    "//base/startup/init_lite/services/include",
52
    "//base/startup/init_lite/services/init/include",
Z
zhong_ning 已提交
53 54 55 56 57
    "//base/startup/init_lite/services/log",
    "//third_party/libuv/include",
    "//third_party/cJSON",
  ]

S
sun_fan 已提交
58 59
  defines = [ "PARAM_SUPPORT_SAVE_PERSIST" ]

60 61 62 63
  if (param_test == "true") {
    defines += [ "PARAM_TEST" ]
  }

S
sun_fan 已提交
64 65 66 67 68 69 70 71
  if (param_security == "selinux") {
    sources += [ "adapter/param_selinux.c" ]
    defines += [ "PARAM_SUPPORT_SELINUX" ]
  } else {
    sources += [ "adapter/param_dac.c" ]
    defines += [ "PARAM_SUPPORT_DAC" ]
  }

Z
zhong_ning 已提交
72 73 74 75 76 77 78 79
  deps = [
    "//third_party/bounds_checking_function:libsec_static",
    "//third_party/libuv:uv_static",
  ]
  part_name = "init"
  subsystem_name = "startup"
}

S
sun_fan 已提交
80
ohos_shared_library("param_client") {
Z
zhong_ning 已提交
81
  sources = [
82
    "//base/startup/init_lite/services/utils/init_utils.c",
Z
zhong_ning 已提交
83 84
    "client/param_request.c",
    "manager/param_manager.c",
S
sun_fan 已提交
85
    "manager/param_message.c",
Z
zhong_ning 已提交
86
    "manager/param_trie.c",
S
sun_fan 已提交
87
    "manager/param_utils.c",
Z
zhong_ning 已提交
88 89 90 91 92 93 94
  ]

  include_dirs = [
    "include",
    "//base/startup/init_lite/services/include/param",
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
S
sun_fan 已提交
95
    "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
Z
zhong_ning 已提交
96 97 98
    "//third_party/libuv/include",
  ]

S
sun_fan 已提交
99 100 101 102 103 104 105 106 107 108
  defines = [ "INIT_AGENT" ]

  if (param_security == "selinux") {
    sources += [ "adapter/param_selinux.c" ]
    defines += [ "PARAM_SUPPORT_SELINUX" ]
  } else {
    sources += [ "adapter/param_dac.c" ]
    defines += [ "PARAM_SUPPORT_DAC" ]
  }

109 110 111 112
  if (param_test == "true") {
    defines += [ "PARAM_TEST" ]
  }

Z
zhong_ning 已提交
113
  deps = [
S
sun_fan 已提交
114
    "//base/startup/init_lite/services/log:agent_log",
Z
zhong_ning 已提交
115 116
    "//third_party/bounds_checking_function:libsec_static",
  ]
S
sun_fan 已提交
117
  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
118
  install_images = [
S
sun_fan 已提交
119 120 121
    "system",
    "updater",
  ]
Z
zhong_ning 已提交
122 123 124
  part_name = "init"
}

S
sun_fan 已提交
125 126 127 128 129 130 131 132
ohos_shared_library("param_watcheragent") {
  sources = [
    "watcher/agent/watcher.cpp",
    "watcher/agent/watcher_manager_kits.cpp",
    "watcher/agent/watcher_manager_proxy.cpp",
    "watcher/agent/watcher_stub.cpp",
  ]

Z
zhong_ning 已提交
133 134 135
  include_dirs = [
    "include",
    "//base/startup/init_lite/services/include/param",
S
sun_fan 已提交
136 137
    "//base/startup/init_lite/services/param/watcher/include",
    "//base/startup/init_lite/services/param/watcher/agent",
Z
zhong_ning 已提交
138 139
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
S
sun_fan 已提交
140
    "//base/update/updateservice/interfaces/innerkits/include",
Z
zhong_ning 已提交
141
  ]
S
sun_fan 已提交
142 143 144

  defines = [ "INIT_AGENT" ]

Z
zhong_ning 已提交
145
  deps = [
S
sun_fan 已提交
146 147
    "//base/startup/init_lite/services/log:agent_log",
    "//base/startup/init_lite/services/param:param_client",
Z
zhong_ning 已提交
148
    "//third_party/bounds_checking_function:libsec_static",
S
sun_fan 已提交
149
    "//utils/native/base:utils",
Z
zhong_ning 已提交
150
  ]
S
sun_fan 已提交
151 152 153 154 155

  external_deps = [
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "safwk:system_ability_fwk",
东方_月初's avatar
东方_月初 已提交
156
    "samgr_standard:samgr_proxy",
S
sun_fan 已提交
157 158
  ]

Z
zhong_ning 已提交
159 160 161
  part_name = "init"
}

S
sun_fan 已提交
162 163
ohos_shared_library("param_watcher") {
  sources = [
X
add ut  
xionglei6 已提交
164
    "//base/startup/init_lite/services/utils/list.c",
S
sun_fan 已提交
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
    "watcher/proxy/watcher_manager.cpp",
    "watcher/proxy/watcher_manager_stub.cpp",
    "watcher/proxy/watcher_proxy.cpp",
  ]

  include_dirs = [
    "include",
    "//base/startup/init_lite/services/include/param",
    "//base/startup/init_lite/services/param/watcher/proxy",
    "//base/startup/init_lite/services/param/watcher/include",
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
    "//third_party/libuv/include",
    "//third_party/cJSON",
    "//utils/native/base/include",
    "//utils/system/safwk/native/include",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
    "//foundation/distributedschedule/safwk/services/safwk/include",
    "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk",
    "//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
  ]

X
add ut  
xionglei6 已提交
188 189 190 191
  defines = [
    "INIT_AGENT",
    "ENABLE_HILOG",
  ]
S
sun_fan 已提交
192 193 194 195 196 197 198 199 200 201 202 203

  deps = [
    "//base/startup/init_lite/services/log:agent_log",
    "//base/startup/init_lite/services/param:param_client",
    "//third_party/bounds_checking_function:libsec_static",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "safwk:system_ability_fwk",
东方_月初's avatar
东方_月初 已提交
204
    "samgr_standard:samgr_proxy",
S
sun_fan 已提交
205 206 207 208
  ]
  install_images = [ "system" ]
  part_name = "init"
}