1# Copyright (c) 2022 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/hdi.gni") 16import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 17import("//drivers/peripheral/audio/audio.gni") 18 19if (defined(ohos_lite)) { 20 ohos_executable("audio_sample_render") { 21 include_dirs = [ 22 "//drivers/peripheral/audio/interfaces/include", 23 "//drivers/peripheral/audio/sample", 24 "//commonlibrary/utils_lite/include", 25 "//third_party/bounds_checking_function/include", 26 ] 27 28 sources = [ 29 "framework_common.c", 30 "framework_render.c", 31 ] 32 33 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 34 external_deps = [ "hdf_core:libhdf_utils" ] 35 defines = [] 36 install_enable = true 37 subsystem_name = "hdf" 38 part_name = "drivers_peripheral_audio" 39 } 40 41 ohos_executable("audio_sample_capture") { 42 include_dirs = [ 43 "//drivers/peripheral/audio/interfaces/include", 44 "//drivers/peripheral/audio/sample", 45 "//commonlibrary/utils_lite/include", 46 "//third_party/bounds_checking_function/include", 47 "//drivers/peripheral/audio/hal/hdi_binder/server/include", 48 ] 49 50 sources = [ 51 "framework_capture.c", 52 "framework_common.c", 53 ] 54 55 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 56 external_deps = [ "hdf_core:libhdf_utils" ] 57 defines = [] 58 install_enable = true 59 subsystem_name = "hdf" 60 part_name = "drivers_peripheral_audio" 61 } 62} else { 63 ohos_executable("audio_sample_render") { 64 include_dirs = [ 65 "//drivers/peripheral/audio/interfaces/include", 66 "//drivers/peripheral/audio/sample", 67 ] 68 69 sources = [ 70 "framework_common.c", 71 "framework_render.c", 72 ] 73 74 defines = [] 75 76 if (is_standard_system) { 77 external_deps = [ 78 "c_utils:utils", 79 "hdf_core:libhdf_utils", 80 "hiviewdfx_hilog_native:libhilog", 81 ] 82 } else { 83 external_deps = [ "hilog:libhilog" ] 84 } 85 86 install_enable = true 87 install_images = [ chipset_base_dir ] 88 subsystem_name = "hdf" 89 part_name = "drivers_peripheral_audio" 90 } 91 92 ohos_executable("audio_sample_capture") { 93 include_dirs = [ 94 "//drivers/peripheral/audio/interfaces/include", 95 "//drivers/peripheral/audio/hal/hdi_binder/server/include", 96 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 97 "//drivers/peripheral/audio/sample", 98 ] 99 100 sources = [ 101 "//drivers/peripheral/audio/hal/hdi_binder/server/src/hdf_audio_events.c", 102 "framework_capture.c", 103 "framework_common.c", 104 ] 105 106 defines = [] 107 108 if (drivers_peripheral_audio_alsa_lib) { 109 defines += [ "ALSA_LIB_MODE" ] 110 } 111 112 if (is_standard_system) { 113 external_deps = [ 114 "c_utils:utils", 115 "hdf_core:libhdf_ipc_adapter", 116 "hdf_core:libhdf_utils", 117 "hiviewdfx_hilog_native:libhilog", 118 ] 119 } else { 120 external_deps = [ "hilog:libhilog" ] 121 } 122 123 install_enable = true 124 install_images = [ chipset_base_dir ] 125 subsystem_name = "hdf" 126 part_name = "drivers_peripheral_audio" 127 } 128 ohos_executable("audio_sample_event") { 129 include_dirs = [ 130 "//drivers/peripheral/audio/interfaces/include", 131 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 132 "//drivers/peripheral/audio/hal/hdi_binder/server/include", 133 ] 134 135 sources = [ 136 "//drivers/peripheral/audio/hal/hdi_binder/server/src/hdf_audio_events.c", 137 "framework_event.c", 138 ] 139 140 defines = [] 141 142 if (is_standard_system) { 143 external_deps = [ 144 "c_utils:utils", 145 "hdf_core:libhdf_utils", 146 "hdf_core:libhdi", 147 "hiviewdfx_hilog_native:libhilog", 148 ] 149 } else { 150 external_deps = [ "hilog:libhilog" ] 151 } 152 153 install_enable = true 154 install_images = [ chipset_base_dir ] 155 subsystem_name = "hdf" 156 part_name = "drivers_peripheral_audio" 157 } 158 159 ohos_executable("idl_render") { 160 include_dirs = [ "//drivers/peripheral/audio/sample" ] 161 162 sources = [ 163 "framework_common.c", 164 "idl_render.c", 165 ] 166 167 defines = [ "IDL_SAMPLE" ] 168 if (drivers_peripheral_audio_alsa_lib) { 169 defines += [ "ALSA_LIB_MODE" ] 170 } 171 172 if (is_standard_system) { 173 external_deps = [ 174 "c_utils:utils", 175 "drivers_interface_audio:libaudio_proxy_1.0", 176 "hdf_core:libhdf_ipc_adapter", 177 "hdf_core:libhdf_utils", 178 "hdf_core:libhdi", 179 "hiviewdfx_hilog_native:libhilog", 180 ] 181 } else { 182 external_deps = [ "hilog:libhilog" ] 183 } 184 185 install_enable = true 186 install_images = [ chipset_base_dir ] 187 subsystem_name = "hdf" 188 part_name = "drivers_peripheral_audio" 189 } 190 191 ohos_executable("idl_capture") { 192 include_dirs = [ "//drivers/peripheral/audio/sample" ] 193 194 sources = [ 195 "framework_common.c", 196 "idl_capture.c", 197 ] 198 199 defines = [ "IDL_SAMPLE" ] 200 if (drivers_peripheral_audio_alsa_lib) { 201 defines += [ "ALSA_LIB_MODE" ] 202 } 203 204 if (is_standard_system) { 205 external_deps = [ 206 "c_utils:utils", 207 "drivers_interface_audio:libaudio_proxy_1.0", 208 "hdf_core:libhdf_ipc_adapter", 209 "hdf_core:libhdf_utils", 210 "hiviewdfx_hilog_native:libhilog", 211 ] 212 } else { 213 external_deps = [ "hilog:libhilog" ] 214 } 215 216 install_enable = true 217 install_images = [ chipset_base_dir ] 218 subsystem_name = "hdf" 219 part_name = "drivers_peripheral_audio" 220 } 221} 222 223group("audio_sample") { 224 if (drivers_peripheral_audio_hdf_proxy_stub == true) { 225 deps = [ 226 ":audio_sample_capture", 227 ":audio_sample_render", 228 ] 229 } 230} 231 232group("idl_audio_sample") { 233 if (!defined(ohos_lite)) { 234 if (drivers_peripheral_audio_hdf_proxy_stub == true) { 235 deps = [ 236 ":idl_capture", 237 ":idl_render", 238 ] 239 } 240 } 241} 242