1# Copyright (c) 2021 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.
13import("//base/startup/init/begetd.gni")
14if (!defined(ohos_lite)) {
15  import("//build/ohos.gni")
16  import("//build/ohos/sa_profile/sa_profile.gni")
17
18  ohos_sa_profile("device_info_profile") {
19    sources = [ "etc/3902.json" ]
20    part_name = "init"
21  }
22
23  ohos_prebuilt_etc("device_info.cfg") {
24    source = "etc/deviceinfoservice.cfg"
25    relative_install_dir = "init"
26    part_name = "init"
27    subsystem_name = "startup"
28  }
29
30  ohos_shared_library("deviceinfoservice") {
31    sources = [
32      "//base/startup/init/interfaces/innerkits/syspara/param_comm.c",
33      "device_info_stub.cpp",
34    ]
35
36    branch_protector_ret = "pac_ret"
37    sanitize = {
38      cfi = true
39      cfi_cross_dso = true
40      debug = false
41    }
42
43    shlib_type = "sa"
44
45    include_dirs = [
46      ".",
47      "//base/startup/init/interfaces/innerkits/include",
48      "//base/startup/init/interfaces/innerkits/include/param",
49      "//base/startup/init/interfaces/innerkits/include/syspara",
50      "//base/startup/init/interfaces/innerkits/syspara",
51      "//base/startup/init/interfaces/hals",
52    ]
53    defines = [
54      "INIT_AGENT",
55      "_GNU_SOURCE",
56      "USE_MBEDTLS",
57      "DINFO_TAG=\"DeviceInfoService\"",
58    ]
59    deps = [
60      "//base/startup/init/interfaces/innerkits:libbegetutil",
61      "//base/startup/init/services/log:agent_log",
62      "//base/startup/init/services/modules/udid:libudidcomm",
63      "//base/startup/init/services/utils:libinit_utils",
64    ]
65
66    external_deps = [
67      "access_token:libaccesstoken_sdk",
68      "bounds_checking_function:libsec_shared",
69      "c_utils:utils",
70      "ipc:ipc_core",
71      "safwk:system_ability_fwk",
72      "samgr:samgr_proxy",
73    ]
74    install_images = [ "system" ]
75    part_name = "init"
76    subsystem_name = "startup"
77  }
78}
79
80group("device_info_group") {
81  if (!defined(ohos_lite) && enable_ohos_startup_init_feature_deviceinfo) {
82    deps = [
83      ":device_info.cfg",
84      ":device_info_profile",
85      ":deviceinfoservice",
86    ]
87  }
88}
89