1794c9f46Sopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
2794c9f46Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3794c9f46Sopenharmony_ci# you may not use this file except in compliance with the License.
4794c9f46Sopenharmony_ci# You may obtain a copy of the License at
5794c9f46Sopenharmony_ci#
6794c9f46Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7794c9f46Sopenharmony_ci#
8794c9f46Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9794c9f46Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10794c9f46Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11794c9f46Sopenharmony_ci# See the License for the specific language governing permissions and
12794c9f46Sopenharmony_ci# limitations under the License.
13794c9f46Sopenharmony_ci
14794c9f46Sopenharmony_ciimport("//build/ohos.gni")
15794c9f46Sopenharmony_ciimport(
16794c9f46Sopenharmony_ci    "//foundation/distributedhardware/distributed_hardware_fwk/distributedhardwarefwk.gni")
17794c9f46Sopenharmony_ci
18794c9f46Sopenharmony_ciconfig("innerkits_external_config") {
19794c9f46Sopenharmony_ci  include_dirs = [
20794c9f46Sopenharmony_ci    "${innerkits_path}/include",
21794c9f46Sopenharmony_ci    "${innerkits_path}/include/ipc",
22794c9f46Sopenharmony_ci  ]
23794c9f46Sopenharmony_ci}
24794c9f46Sopenharmony_ci
25794c9f46Sopenharmony_ciohos_shared_library("libdhfwk_sdk") {
26794c9f46Sopenharmony_ci  sanitize = {
27794c9f46Sopenharmony_ci    boundary_sanitize = true
28794c9f46Sopenharmony_ci    integer_overflow = true
29794c9f46Sopenharmony_ci    ubsan = true
30794c9f46Sopenharmony_ci    cfi = true
31794c9f46Sopenharmony_ci    cfi_cross_dso = true
32794c9f46Sopenharmony_ci    debug = false
33794c9f46Sopenharmony_ci  }
34794c9f46Sopenharmony_ci  branch_protector_ret = "pac_ret"
35794c9f46Sopenharmony_ci  public_configs = [ ":innerkits_external_config" ]
36794c9f46Sopenharmony_ci
37794c9f46Sopenharmony_ci  include_dirs = [
38794c9f46Sopenharmony_ci    "${av_center_kits_path}/include",
39794c9f46Sopenharmony_ci    "${av_trans_path}/common/include",
40794c9f46Sopenharmony_ci    "${av_trans_path}/interface",
41794c9f46Sopenharmony_ci    "${innerkits_path}/include",
42794c9f46Sopenharmony_ci    "${innerkits_path}/include/ipc",
43794c9f46Sopenharmony_ci    "${common_path}/log/include",
44794c9f46Sopenharmony_ci    "${common_path}/utils/include",
45794c9f46Sopenharmony_ci    "${utils_path}/include",
46794c9f46Sopenharmony_ci    "${utils_path}/include/log",
47794c9f46Sopenharmony_ci    "${services_path}/distributedhardwarefwkservice/include",
48794c9f46Sopenharmony_ci  ]
49794c9f46Sopenharmony_ci
50794c9f46Sopenharmony_ci  sources = [
51794c9f46Sopenharmony_ci    "${av_center_kits_path}/src/av_trans_control_center_callback.cpp",
52794c9f46Sopenharmony_ci    "${av_center_kits_path}/src/av_trans_control_center_callback_stub.cpp",
53794c9f46Sopenharmony_ci    "${innerkits_path}/src/distributed_hardware_fwk_kit.cpp",
54794c9f46Sopenharmony_ci    "${innerkits_path}/src/ipc/dhfwk_sa_manager.cpp",
55794c9f46Sopenharmony_ci    "${innerkits_path}/src/ipc/distributed_hardware_proxy.cpp",
56794c9f46Sopenharmony_ci    "${innerkits_path}/src/ipc/publisher_listener_stub.cpp",
57794c9f46Sopenharmony_ci  ]
58794c9f46Sopenharmony_ci
59794c9f46Sopenharmony_ci  deps = [
60794c9f46Sopenharmony_ci    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
61794c9f46Sopenharmony_ci    "${utils_path}:distributedhardwareutils",
62794c9f46Sopenharmony_ci  ]
63794c9f46Sopenharmony_ci
64794c9f46Sopenharmony_ci  defines = [
65794c9f46Sopenharmony_ci    "HI_LOG_ENABLE",
66794c9f46Sopenharmony_ci    "DH_LOG_TAG=\"dhfwkkit\"",
67794c9f46Sopenharmony_ci    "LOG_DOMAIN=0xD004100",
68794c9f46Sopenharmony_ci  ]
69794c9f46Sopenharmony_ci
70794c9f46Sopenharmony_ci  cflags = [
71794c9f46Sopenharmony_ci    "-fstack-protector-strong",
72794c9f46Sopenharmony_ci    "-D_FORTIFY_SOURCE=2",
73794c9f46Sopenharmony_ci    "-O2",
74794c9f46Sopenharmony_ci  ]
75794c9f46Sopenharmony_ci
76794c9f46Sopenharmony_ci  external_deps = [
77794c9f46Sopenharmony_ci    "cJSON:cjson",
78794c9f46Sopenharmony_ci    "c_utils:utils",
79794c9f46Sopenharmony_ci    "hilog:libhilog",
80794c9f46Sopenharmony_ci    "hisysevent:libhisysevent",
81794c9f46Sopenharmony_ci    "ipc:ipc_core",
82794c9f46Sopenharmony_ci    "safwk:system_ability_fwk",
83794c9f46Sopenharmony_ci    "samgr:samgr_proxy",
84794c9f46Sopenharmony_ci  ]
85794c9f46Sopenharmony_ci
86794c9f46Sopenharmony_ci  cflags_cc = [
87794c9f46Sopenharmony_ci    "-DHILOG_ENABLE",
88794c9f46Sopenharmony_ci    "-fstack-protector-strong",
89794c9f46Sopenharmony_ci    "-D_FORTIFY_SOURCE=2",
90794c9f46Sopenharmony_ci    "-O2",
91794c9f46Sopenharmony_ci  ]
92794c9f46Sopenharmony_ci
93794c9f46Sopenharmony_ci  innerapi_tags = [ "platformsdk" ]
94794c9f46Sopenharmony_ci  subsystem_name = "distributedhardware"
95794c9f46Sopenharmony_ci  part_name = "distributed_hardware_fwk"
96794c9f46Sopenharmony_ci}
97