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