• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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/config/components/idl_tool/idl.gni")
15import("//build/ohos.gni")
16import(
17    "//foundation/distributedhardware/distributed_hardware_fwk/distributedhardwarefwk.gni")
18
19config("innerkits_external_config") {
20  include_dirs = [
21    "${innerkits_path}/include",
22    "${innerkits_path}/include/ipc",
23    "${target_gen_dir}",
24  ]
25}
26
27idl_gen_interface("dhfwk_idl_hardware") {
28  sources = [
29    "IAvTransControlCenterCallback.idl",
30  ]
31  log_domainid = "0xD004100"
32  log_tag = "distributedhardware"
33}
34
35config("dhfwk_idl_hardware_config") {
36  include_dirs = [
37    "include",
38    "${av_trans_path}/common/include",
39    "${innerkits_path}/include",
40    ".",
41    "${target_gen_dir}",
42    "${common_path}/utils/include",
43  ]
44}
45
46ohos_source_set("dhfwk_idl_hardware_source") {
47  sanitize = {
48    cfi = true
49    cfi_cross_dso = true
50    debug = false
51  }
52  public_configs = [ ":dhfwk_idl_hardware_config" ]
53  output_values = get_target_outputs(":dhfwk_idl_hardware")
54  sources = filter_include(output_values, [ "*.cpp" ])
55  deps = [ ":dhfwk_idl_hardware" ]
56
57  external_deps = [
58    "c_utils:utils",
59    "hilog:libhilog",
60    "hitrace:hitrace_meter",
61    "ipc:ipc_core",
62    "safwk:system_ability_fwk",
63    "samgr:samgr_proxy",
64  ]
65
66  subsystem_name = "distributedhardware"
67
68  part_name = "distributed_hardware_fwk"
69}
70
71ohos_source_set("dhfwk_idl_hardware_head") {
72  sanitize = {
73    cfi = true
74    cfi_cross_dso = true
75    debug = false
76  }
77  public_configs = [ ":dhfwk_idl_hardware_config" ]
78  deps = [ ":dhfwk_idl_hardware" ]
79
80  external_deps = [
81    "c_utils:utils",
82    "hilog:libhilog",
83    "hitrace:hitrace_meter",
84    "ipc:ipc_core",
85    "safwk:system_ability_fwk",
86    "samgr:samgr_proxy",
87  ]
88
89  subsystem_name = "distributedhardware"
90
91  part_name = "distributed_hardware_fwk"
92}
93
94ohos_shared_library("libdhfwk_sdk") {
95  sanitize = {
96    boundary_sanitize = true
97    integer_overflow = true
98    ubsan = true
99    cfi = true
100    cfi_cross_dso = true
101    debug = false
102  }
103  branch_protector_ret = "pac_ret"
104  public_configs = [ ":innerkits_external_config" ]
105
106  include_dirs = [
107    "${av_center_kits_path}/include",
108    "${av_trans_path}/common/include",
109    "${av_trans_path}/interface",
110    "${innerkits_path}/include",
111    "${innerkits_path}/include/ipc",
112    "${common_path}/log/include",
113    "${common_path}/utils/include",
114    "${utils_path}/include",
115    "${services_path}/distributedhardwarefwkservice/include",
116  ]
117
118  sources = [
119    "${av_center_kits_path}/src/av_trans_control_center_callback.cpp",
120    "${innerkits_path}/src/distributed_hardware_fwk_kit.cpp",
121    "${innerkits_path}/src/ipc/dhfwk_sa_manager.cpp",
122    "${innerkits_path}/src/ipc/distributed_hardware_proxy.cpp",
123    "${innerkits_path}/src/ipc/get_dh_descriptors_callback_stub.cpp",
124    "${innerkits_path}/src/ipc/hardware_status_listener_stub.cpp",
125    "${innerkits_path}/src/ipc/publisher_listener_stub.cpp",
126  ]
127
128  deps = [
129    ":dhfwk_idl_hardware_source",
130    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
131    "${utils_path}:distributedhardwareutils",
132  ]
133
134  defines = [
135    "HI_LOG_ENABLE",
136    "DH_LOG_TAG=\"dhfwkkit\"",
137    "LOG_DOMAIN=0xD004100",
138  ]
139
140  cflags = [
141    "-fstack-protector-strong",
142    "-D_FORTIFY_SOURCE=2",
143    "-O2",
144  ]
145
146  external_deps = [
147    "cJSON:cjson",
148    "c_utils:utils",
149    "hilog:libhilog",
150    "hisysevent:libhisysevent",
151    "hitrace:hitrace_meter",
152    "ipc:ipc_core",
153    "safwk:system_ability_fwk",
154    "samgr:samgr_proxy",
155  ]
156
157  cflags_cc = [
158    "-DHILOG_ENABLE",
159    "-fstack-protector-strong",
160    "-D_FORTIFY_SOURCE=2",
161    "-O2",
162  ]
163
164  ldflags = [
165    "-fpie",
166    "-Wl,-z,relro",
167    "-Wl,-z,now",
168  ]
169
170  subsystem_name = "distributedhardware"
171
172  part_name = "distributed_hardware_fwk"
173}
174