1# Copyright (c) 2021-2023 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
14import("//build/ohos.gni")
15import("./../uhdf.gni")
16
17hdf_framework_path = "./../../../framework"
18hdf_interfaces_path = "./../../../interfaces"
19hdf_uhdf_path = "./.."
20
21ohos_executable("hdf_devmgr") {
22  branch_protector_ret = "pac_ret"
23  sanitize = {
24    cfi = true
25    cfi_cross_dso = true
26    debug = false
27  }
28  defines = [ "__USER__" ]
29  include_dirs = [
30    "$hdf_framework_path/core/manager/include",
31    "$hdf_framework_path/core/common/include/manager/",
32    "$hdf_framework_path/core/host/include",
33    "$hdf_framework_path/core/shared/include",
34    "$hdf_framework_path/utils/include",
35    "$hdf_uhdf_path/include/host",
36    "$hdf_uhdf_path/shared/include",
37    "$hdf_uhdf_path/manager/include",
38    "$hdf_uhdf_path/host/include",
39    "$hdf_uhdf_path/security/include",
40    "$hdf_uhdf_path/utils/include",
41    "include",
42    "$hdf_interfaces_path/inner_api/core",
43    "$hdf_interfaces_path/inner_api/host/shared",
44    "$hdf_interfaces_path/inner_api/host/uhdf",
45  ]
46
47  sources = [
48    "$hdf_framework_path/core/common/src/hdf_attribute.c",
49    "$hdf_framework_path/core/manager/src/devhost_service_clnt.c",
50    "$hdf_framework_path/core/manager/src/device_token_clnt.c",
51    "$hdf_framework_path/core/manager/src/devmgr_service.c",
52    "$hdf_framework_path/core/manager/src/devsvc_manager.c",
53    "$hdf_framework_path/core/manager/src/hdf_driver_installer.c",
54    "$hdf_framework_path/core/manager/src/hdf_host_info.c",
55    "$hdf_framework_path/core/shared/src/hdf_device_info.c",
56    "$hdf_framework_path/core/shared/src/hdf_object_manager.c",
57    "$hdf_framework_path/core/shared/src/hdf_service_record.c",
58    "$hdf_uhdf_path/shared/src/dev_attribute_serialize.c",
59    "$hdf_uhdf_path/shared/src/hcb_config_entry.c",
60    "device_manager.c",
61    "src/devhost_service_proxy.c",
62    "src/device_token_proxy.c",
63    "src/devmgr_dump.c",
64    "src/devmgr_object_config.c",
65    "src/devmgr_query_device.c",
66    "src/devmgr_service_full.c",
67    "src/devmgr_service_stub.c",
68    "src/devmgr_uevent.c",
69    "src/devsvc_manager_stub.c",
70    "src/driver_installer_full.c",
71    "src/servstat_listener_holder.c",
72  ]
73
74  deps = [
75    "../ipc:libhdf_ipc_adapter",
76    "../utils:libhdf_utils",
77  ]
78
79  external_deps = [
80    "c_utils:utils",
81    "hilog:libhilog",
82    "init:libbegetutil",
83  ]
84
85  if (build_selinux) {
86    external_deps += [ "selinux_adapter:libservice_checker" ]
87    cflags = [ "-DWITH_SELINUX" ]
88  }
89
90  install_enable = true
91  install_images = [ chipset_base_dir ]
92  subsystem_name = "hdf"
93  part_name = "hdf_core"
94}
95
96ohos_prebuilt_etc("hdf_devmgr.cfg") {
97  source = "hdf_devmgr.cfg"
98  relative_install_dir = "init"
99  install_images = [ chipset_base_dir ]
100  subsystem_name = "hdf"
101  part_name = "hdf_core"
102}
103
104ohos_prebuilt_etc("hdf_pnp.cfg") {
105  source = "hdf_pnp.cfg"
106  relative_install_dir = "hdfconfig"
107  install_images = [ chipset_base_dir ]
108  subsystem_name = "hdf"
109  part_name = "hdf_core"
110}
111
112ohos_prebuilt_etc("hdf_devmgr.para.dac") {
113  source = "hdf_devmgr.para.dac"
114  relative_install_dir = "param"
115  install_images = [ chipset_base_dir ]
116  subsystem_name = "hdf"
117  part_name = "hdf_core"
118}
119