1# Copyright (c) 2021 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} 19import("//drivers/adapter/uhdf2/uhdf.gni") 20 21config("hdi_service_proxy_config") { 22 visibility = [ ":*" ] 23 24 cflags = [ 25 "-Wall", 26 "-Wextra", 27 "-Werror", 28 "-DGST_DISABLE_DEPRECATED", 29 "-DHAVE_CONFIG_H", 30 "-fno-strict-aliasing", 31 "-Wno-sign-compare", 32 "-Wno-builtin-requires-header", 33 "-Wno-implicit-function-declaration", 34 "-Wno-format", 35 "-Wno-int-conversion", 36 "-Wno-unused-function", 37 "-Wno-unused-parameter", 38 "-Wno-thread-safety-attributes", 39 "-Wno-inconsistent-missing-override", 40 "-fno-rtti", 41 "-fno-exceptions", 42 "-ffunction-sections", 43 "-fdata-sections", 44 ] 45 46 ldflags = [ "-Wl" ] 47} 48 49if (defined(ohos_lite)) { 50 shared_library("audio_hdi_proxy_server") { 51 include_dirs = [ 52 "//drivers/peripheral/audio/interfaces/include", 53 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 54 "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", 55 "//drivers/peripheral/audio/hal/hdi_binder/server/include", 56 "$hdf_framework_path/include/core", 57 "$hdf_framework_path/include/utils", 58 "$hdf_framework_path/include/osal", 59 "$hdf_framework_path/ability/sbuf/include", 60 "$hdf_framework_path/utils/include", 61 "$hdf_framework_path/include", 62 "$hdf_framework_path/core/sec/include", 63 "$hdf_framework_path/core/shared/include", 64 "$hdf_framework_path/core/host/include", 65 "$hdf_framework_path/core/manager/include", 66 "$hdf_framework_path/core/common/include/host/", 67 "//third_party/cJSON", 68 "//third_party/bounds_checking_function/include", 69 "//drivers/adapter/khdf/liteos/osal/include", 70 "$hdf_uhdf_path/shared/include", 71 "$hdf_uhdf_path/include/hdi/", 72 "$hdf_uhdf_path/host/include", 73 ] 74 75 sources = [ 76 "$hdf_framework_path/ability/sbuf/src/hdf_sbuf.c", 77 "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_adapter_info_common.c", 78 "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c", 79 "//third_party/cJSON/cJSON.c", 80 "src/audio_proxy_adapter.c", 81 "src/audio_proxy_capture.c", 82 "src/audio_proxy_common.c", 83 "src/audio_proxy_manager.c", 84 "src/audio_proxy_render.c", 85 ] 86 87 deps = [ 88 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 89 "//third_party/bounds_checking_function:libsec_shared", 90 ] 91 92 public_configs = [ ":hdi_service_proxy_config" ] 93 } 94 95 lite_component("hdi_audio") { 96 features = [ ":audio_hdi_proxy_server" ] 97 } 98} else { 99 ohos_shared_library("audio_hdi_proxy_server") { 100 include_dirs = [ 101 "//drivers/peripheral/audio/interfaces/include", 102 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 103 "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", 104 "//drivers/peripheral/audio/hal/hdi_binder/server/include", 105 "//third_party/cJSON", 106 "$hdf_framework_path/include/core", 107 "$hdf_framework_path/include/utils", 108 "$hdf_framework_path/include/osal", 109 "$hdf_framework_path/include", 110 "//third_party/bounds_checking_function/include", 111 "$hdf_framework_path/ability/sbuf/include", 112 "$hdf_framework_path/utils/include", 113 "$hdf_framework_path/ability/sbuf/include", 114 "$hdf_uhdf_path/osal/include", 115 "$hdf_framework_path/include", 116 "$hdf_framework_path/core/sec/include", 117 "$hdf_framework_path/core/shared/include", 118 "$hdf_framework_path/core/host/include", 119 "$hdf_framework_path/core/manager/include", 120 "$hdf_uhdf_path/include/devhost", 121 "$hdf_uhdf_path/devhost/include", 122 "$hdf_uhdf_path/devmgr/include", 123 "$hdf_uhdf_path/host/include", 124 "$hdf_uhdf_path/manager/include", 125 "$hdf_uhdf_path/include/host", 126 ] 127 128 sources = [ 129 "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_adapter_info_common.c", 130 "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c", 131 "//third_party/cJSON/cJSON.c", 132 "src/audio_proxy_adapter.c", 133 "src/audio_proxy_capture.c", 134 "src/audio_proxy_common.c", 135 "src/audio_proxy_manager.c", 136 "src/audio_proxy_render.c", 137 ] 138 139 deps = [ 140 "$hdf_uhdf_path/config:libhdf_hcs", 141 "$hdf_uhdf_path/hcs:hdf_default.hcb", 142 "$hdf_uhdf_path/hdi:libhdi", 143 "$hdf_uhdf_path/host:hdf_devhost", 144 "$hdf_uhdf_path/host:libhdf_host", 145 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 146 "$hdf_uhdf_path/manager:hdf_devmgr", 147 "$hdf_uhdf_path/manager:hdf_devmgr.rc", 148 "$hdf_uhdf_path/osal:libhdf_utils", 149 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 150 "//utils/native/base:utils", 151 ] 152 153 if (is_standard_system) { 154 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 155 } else { 156 external_deps = [ "hilog:libhilog" ] 157 } 158 159 public_configs = [ ":hdi_service_proxy_config" ] 160 161 subsystem_name = "hdf" 162 } 163} 164