1# Copyright (c) 2021-2024 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 = [ ":utils_external_config" ]
36
37  include_dirs = [
38    "${common_path}/log/include",
39    "${common_path}/utils/include",
40    "include",
41    "include/log",
42  ]
43
44  sources = [
45    "src/anonymous_string.cpp",
46    "src/device_param_mgr.cpp",
47    "src/dh_utils_hisysevent.cpp",
48    "src/dh_utils_hitrace.cpp",
49    "src/dh_utils_tool.cpp",
50    "src/histreamer_ability_parser.cpp",
51    "src/histreamer_query_tool.cpp",
52  ]
53
54  defines = [
55    "HI_LOG_ENABLE",
56    "DH_LOG_TAG=\"distributedhardwareutils\"",
57    "LOG_DOMAIN=0xD004100",
58    "OPENSSL_SUPPRESS_DEPRECATED",
59  ]
60
61  cflags = [
62    "-fstack-protector-strong",
63    "-D_FORTIFY_SOURCE=2",
64    "-O2",
65  ]
66
67  cflags_cc = cflags
68
69  external_deps = [
70    "cJSON:cjson",
71    "c_utils:utils",
72    "device_manager:devicemanagersdk",
73    "hilog:libhilog",
74    "hisysevent:libhisysevent",
75    "hitrace:hitrace_meter",
76    "init:libbegetutil",
77    "openssl:libcrypto_shared",
78    "safwk:system_ability_fwk",
79    "zlib:shared_libz",
80  ]
81
82  subsystem_name = "distributedhardware"
83
84  part_name = "distributed_hardware_fwk"
85}
86