• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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(
16    "//foundation/distributedhardware/distributed_hardware_fwk/distributedhardwarefwk.gni")
17
18config("utils_external_config") {
19  include_dirs = [
20    "${common_path}/utils/include",
21    "${utils_path}/include",
22  ]
23}
24
25ohos_shared_library("distributedhardwareutils") {
26  sanitize = {
27    boundary_sanitize = true
28    integer_overflow = true
29    ubsan = true
30    cfi = true
31    cfi_cross_dso = true
32    debug = false
33  }
34  branch_protector_ret = "pac_ret"
35  public_configs = [
36    ":utils_external_config",
37    "${innerkits_path}:dhfwk_idl_hardware_config"
38  ]
39
40  include_dirs = [
41    "${common_path}/log/include",
42    "${common_path}/utils/include",
43    "include",
44  ]
45
46  sources = [
47    "src/anonymous_string.cpp",
48    "src/device_param_mgr.cpp",
49    "src/dh_utils_hisysevent.cpp",
50    "src/dh_utils_hitrace.cpp",
51    "src/dh_utils_tool.cpp",
52    "src/histreamer_ability_parser.cpp",
53    "src/histreamer_query_tool.cpp",
54  ]
55
56  defines = [
57    "HI_LOG_ENABLE",
58    "DH_LOG_TAG=\"distributedhardwareutils\"",
59    "LOG_DOMAIN=0xD004100",
60    "OPENSSL_SUPPRESS_DEPRECATED",
61  ]
62
63  cflags = [
64    "-fstack-protector-strong",
65    "-D_FORTIFY_SOURCE=2",
66    "-O2",
67  ]
68
69  cflags_cc = cflags
70
71  ldflags = [
72    "-fpie",
73    "-Wl,-z,relro",
74    "-Wl,-z,now",
75  ]
76
77  external_deps = [
78    "cJSON:cjson",
79    "c_utils:utils",
80    "device_manager:devicemanagersdk",
81    "hilog:libhilog",
82    "hisysevent:libhisysevent",
83    "hitrace:hitrace_meter",
84    "init:libbegetutil",
85    "openssl:libcrypto_shared",
86    "zlib:shared_libz",
87  ]
88
89  subsystem_name = "distributedhardware"
90
91  part_name = "distributed_hardware_fwk"
92}
93