• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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
14if (defined(ohos_lite)) {
15  import("//build/lite/config/component/lite_component.gni")
16} else {
17  import("//build/ohos.gni")
18}
19
20import("//foundation/distributedhardware/device_manager/device_manager.gni")
21
22if (defined(ohos_lite)) {
23  if (ohos_kernel_type == "linux") {
24    shared_library("devicemanagerutils") {
25      include_dirs = [
26        "include",
27        "include/crypto",
28        "include/fwkload/lite",
29        "include/appInfo/lite",
30        "include/timer",
31        "${common_path}/include",
32        "${common_path}/include/dfx",
33        "${common_path}/include/dfx/lite",
34        "${common_path}/include/ipc",
35        "${common_path}/include/ipc/lite",
36        "${common_path}/include/ipc/model",
37        "${innerkits_path}/native_cpp/include",
38        "${interfaces_path}/c/ipc/include",
39        "//third_party/json/include",
40        "//third_party/bounds_checking_function/include",
41      ]
42
43      sources = [
44        "${common_path}/src/dfx/lite/dm_hidumper.cpp",
45        "${common_path}/src/dfx/lite/dm_hisysevent.cpp",
46        "${common_path}/src/dfx/lite/dm_hitrace.cpp",
47        "${common_path}/src/dm_anonymous.cpp",
48        "${common_path}/src/dm_error_message.cpp",
49        "${common_path}/src/dm_log.cpp",
50        "${common_path}/src/ipc/lite/ipc_cmd_register.cpp",
51        "src/appInfo/lite/app_manager.cpp",
52        "src/crypto/dm_crypto.cpp",
53        "src/dm_random.cpp",
54        "src/fwkload/lite/dm_distributed_hardware_load.cpp",
55        "src/timer/dm_timer.cpp",
56      ]
57
58      defines = [
59        "LITE_DEVICE",
60        "hI_LOG_ENABLE",
61        "DH_LOG_TAG=\"devicemanagerutils\"",
62        "lOG_DOMAIN=0xD004110",
63      ]
64
65      deps = [
66        "//third_party/bounds_checking_function:libsec_shared",
67        "//third_party/mbedtls:mbedtls_shared",
68        "//third_party/openssl:libcrypto_shared",
69      ]
70    }
71  }
72} else {
73  config("devicemanagerutils_config") {
74    include_dirs = [
75      "include",
76      "include/crypto",
77      "include/fwkload/standard",
78      "include/appInfo/standard",
79      "include/timer",
80      "${common_path}/include",
81      "//third_party/mbedtls/include/mbedtls",
82      "//third_party/json/include",
83    ]
84  }
85
86  ohos_shared_library("devicemanagerutils") {
87    branch_protector_ret = "pac_ret"
88
89    sanitize = {
90      boundary_sanitize = true
91      cfi = true
92      cfi_cross_dso = true
93      debug = false
94      integer_overflow = true
95      ubsan = true
96    }
97
98    sources = [
99      "${common_path}/src/dm_log.cpp",
100      "src/appInfo/standard/app_manager.cpp",
101      "src/crypto/dm_crypto.cpp",
102      "src/dm_random.cpp",
103      "src/timer/dm_timer.cpp",
104    ]
105
106    if (support_jsapi) {
107      sources += [ "src/fwkload/standard/dm_distributed_hardware_load.cpp" ]
108    }
109
110    public_configs = [ ":devicemanagerutils_config" ]
111
112    defines = [
113      "HI_LOG_ENABLE",
114      "DH_LOG_TAG=\"devicemanagerutils\"",
115      "LOG_DOMAIN=0xD004110",
116    ]
117
118    deps = [
119      "//third_party/mbedtls:mbedtls_shared",
120      "//third_party/openssl:libcrypto_shared",
121    ]
122
123    external_deps = [
124      "access_token:libaccesstoken_sdk",
125      "bundle_framework:appexecfwk_base",
126      "c_utils:utils",
127      "hilog:libhilog",
128      "ipc:ipc_core",
129      "ipc:ipc_single",
130      "samgr:samgr_proxy",
131    ]
132
133    if (support_jsapi) {
134      external_deps += [ "bundle_framework:appexecfwk_core" ]
135    }
136
137    subsystem_name = "distributedhardware"
138
139    part_name = "device_manager"
140  }
141}
142