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 14import("//build/ohos.gni") 15import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 16import("//drivers/peripheral/audio/audio.gni") 17 18if (defined(ohos_lite)) { 19 ohos_shared_library("hdi_audio") { 20 sources = [ 21 "src/audio_adapter.c", 22 "src/audio_capture.c", 23 "src/audio_manager.c", 24 "src/audio_render.c", 25 ] 26 27 include_dirs = [ 28 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 29 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 30 "//drivers/peripheral/audio/supportlibs/interfaces/include", 31 "//third_party/cJSON", 32 "//drivers/peripheral/audio/interfaces/include", 33 "//third_party/bounds_checking_function/include", 34 ] 35 deps = [ 36 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 37 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common", 38 "//third_party/bounds_checking_function:libsec_shared", 39 ] 40 external_deps = [ "hdf_core:libhdf_utils" ] 41 defines = [] 42 if (drivers_peripheral_audio_hal_notsupport_pathselect) { 43 defines += [ "AUDIO_HAL_NOTSUPPORT_PATHSELECT" ] 44 } 45 46 if (enable_audio_hal_hdf_log) { 47 defines += [ "AUDIO_HDF_LOG" ] 48 } 49 ldflags = [ 50 "-L$ohos_root_path/sysroot/usr/lib", 51 "-Wl,-rpath-link=$ohos_root_path/sysroot/usr/lib", 52 "-lstdc++", 53 "-ldl", 54 "-lm", 55 ] 56 57 subsystem_name = "hdf" 58 part_name = "drivers_peripheral_audio" 59 } 60} else { 61 if (!drivers_peripheral_audio_user_mode) { 62 ohos_shared_library("hdi_audio") { 63 sources = [ 64 "src/audio_adapter.c", 65 "src/audio_capture.c", 66 "src/audio_manager.c", 67 "src/audio_render.c", 68 ] 69 70 include_dirs = [ 71 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 72 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 73 "//drivers/peripheral/audio/supportlibs/interfaces/include", 74 "//third_party/cJSON", 75 "//drivers/peripheral/audio/interfaces/include", 76 "//third_party/bounds_checking_function/include", 77 ] 78 79 defines = [] 80 81 if (drivers_peripheral_audio_hal_notsupport_pathselect) { 82 defines += [ "AUDIO_HAL_NOTSUPPORT_PATHSELECT" ] 83 } 84 if (enable_audio_hal_hdf_log) { 85 defines += [ "AUDIO_HDF_LOG" ] 86 } 87 if (is_standard_system) { 88 external_deps = [ 89 "c_utils:utils", 90 "hdf_core:libhdf_utils", 91 "hiviewdfx_hilog_native:libhilog", 92 ] 93 } else { 94 external_deps = [ "hilog:libhilog" ] 95 } 96 97 deps = 98 [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common" ] 99 100 install_images = [ chipset_base_dir ] 101 subsystem_name = "hdf" 102 part_name = "drivers_peripheral_audio" 103 } 104 } 105} 106 107if (defined(ohos_lite)) { 108 ohos_shared_library("hdi_audio_common") { 109 sources = [ 110 "//third_party/cJSON/cJSON.c", 111 "src/audio_adapter_info_common.c", 112 "src/audio_common.c", 113 ] 114 115 include_dirs = [ 116 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 117 "//drivers/peripheral/audio/hal/common/include", 118 "//third_party/cJSON", 119 "//drivers/peripheral/audio/interfaces/include", 120 "//third_party/bounds_checking_function/include", 121 ] 122 deps = [ 123 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 124 "//third_party/bounds_checking_function:libsec_shared", 125 ] 126 external_deps = [ "hdf_core:libhdf_utils" ] 127 defines = [] 128 if (drivers_peripheral_audio_hal_notsupport_pathselect) { 129 defines += [ "AUDIO_HAL_NOTSUPPORT_PATHSELECT" ] 130 } 131 132 ldflags = [ 133 "-L$ohos_root_path/sysroot/usr/lib", 134 "-Wl,-rpath-link=$ohos_root_path/sysroot/usr/lib", 135 "-lstdc++", 136 "-ldl", 137 "-lm", 138 ] 139 140 subsystem_name = "hdf" 141 part_name = "drivers_peripheral_audio" 142 } 143} else { 144 ohos_shared_library("hdi_audio_common") { 145 sources = [ 146 "//third_party/cJSON/cJSON.c", 147 "src/audio_adapter_info_common.c", 148 "src/audio_common.c", 149 ] 150 151 include_dirs = [ 152 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 153 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 154 "//drivers/peripheral/audio/supportlibs/interfaces/include", 155 "//third_party/cJSON", 156 "//drivers/peripheral/audio/interfaces/include", 157 "//third_party/bounds_checking_function/include", 158 ] 159 160 defines = [] 161 162 if (drivers_peripheral_audio_hal_notsupport_pathselect) { 163 defines += [ "AUDIO_HAL_NOTSUPPORT_PATHSELECT" ] 164 } 165 166 if (is_standard_system) { 167 external_deps = [ 168 "c_utils:utils", 169 "hdf_core:libhdf_utils", 170 "hiviewdfx_hilog_native:libhilog", 171 ] 172 } else { 173 external_deps = [ "hilog:libhilog" ] 174 } 175 176 install_images = [ chipset_base_dir ] 177 subsystem_name = "hdf" 178 part_name = "drivers_peripheral_audio" 179 } 180} 181