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 22if (defined(ohos_lite)) { 23 executable("audio_sample_render") { 24 include_dirs = [ 25 "//drivers/peripheral/audio/interfaces/include", 26 "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", 27 "//utils/native/base/include", 28 "$hdf_framework_path/include", 29 "$hdf_framework_path/include/osal", 30 "$hdf_framework_path/include/utils", 31 "$hdf_framework_path/utils/include", 32 "$hdf_framework_path/ability/sbuf/include", 33 "$hdf_framework_path/core/adapter/syscall/include", 34 "$hdf_framework_path/core/adapter/vnode/include", 35 "$hdf_framework_path/core/shared/include", 36 "$hdf_framework_path/include/core/", 37 "$hdf_uhdf_path/osal/include", 38 "$hdf_uhdf_path/include/hdi", 39 "$hdf_uhdf_path/ipc/include", 40 "$hdf_uhdf_path/include/config", 41 "$hdf_uhdf_path/include/osal", 42 "$hdf_uhdf_path/include/host", 43 "$hdf_uhdf_path/shared/include", 44 "$hdf_uhdf_path/manager/include", 45 "$hdf_uhdf_path/host/include", 46 "$hdf_uhdf_path/include", 47 "$hdf_uhdf_path/common/security/include", 48 "//third_party/bounds_checking_function/include", 49 ] 50 51 sources = [ "framework_render.c" ] 52 53 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 54 55 defines = [] 56 if (enable_audio_device_mpi) { 57 defines += [ "AUDIO_HAL_USER" ] 58 } 59 } 60 61 executable("audio_sample_capture") { 62 include_dirs = [ 63 "//drivers/peripheral/audio/interfaces/include", 64 "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", 65 "//utils/native/base/include", 66 "$hdf_framework_path/include", 67 "$hdf_framework_path/include/osal", 68 "$hdf_framework_path/include/utils", 69 "$hdf_framework_path/utils/include", 70 "$hdf_framework_path/ability/sbuf/include", 71 "$hdf_framework_path/core/adapter/syscall/include", 72 "$hdf_framework_path/core/adapter/vnode/include", 73 "$hdf_framework_path/core/shared/include", 74 "$hdf_framework_path/include/core/", 75 "$hdf_uhdf_path/osal/include", 76 "$hdf_uhdf_path/include/hdi", 77 "$hdf_uhdf_path/ipc/include", 78 "$hdf_uhdf_path/include/config", 79 "$hdf_uhdf_path/include/osal", 80 "$hdf_uhdf_path/include/host", 81 "$hdf_uhdf_path/shared/include", 82 "$hdf_uhdf_path/manager/include", 83 "$hdf_uhdf_path/host/include", 84 "$hdf_uhdf_path/include", 85 "$hdf_uhdf_path/common/security/include", 86 "//third_party/bounds_checking_function/include", 87 ] 88 89 sources = [ "framework_capture.c" ] 90 91 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 92 93 defines = [] 94 if (enable_audio_device_mpi) { 95 defines += [ "AUDIO_HAL_USER" ] 96 } 97 } 98} else { 99 ohos_executable("audio_sample_render") { 100 include_dirs = [ 101 "//drivers/peripheral/audio/interfaces/include", 102 "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", 103 "//utils/native/base/include", 104 "$hdf_framework_path/include", 105 "$hdf_framework_path/include/osal", 106 "$hdf_framework_path/include/utils", 107 "$hdf_framework_path/utils/include", 108 "$hdf_framework_path/ability/sbuf/include", 109 "$hdf_framework_path/core/adapter/syscall/include", 110 "$hdf_framework_path/core/adapter/vnode/include", 111 "$hdf_framework_path/core/shared/include", 112 "$hdf_framework_path/include/core/", 113 "$hdf_uhdf_path/osal/include", 114 "$hdf_uhdf_path/include/hdi", 115 "$hdf_uhdf_path/ipc/include", 116 "$hdf_uhdf_path/include/config", 117 "$hdf_uhdf_path/include/osal", 118 "$hdf_uhdf_path/include/host", 119 "$hdf_uhdf_path/shared/include", 120 "$hdf_uhdf_path/manager/include", 121 "$hdf_uhdf_path/host/include", 122 "$hdf_uhdf_path/include", 123 "$hdf_uhdf_path/common/security/include", 124 ] 125 126 sources = [ "framework_render.c" ] 127 128 deps = [ 129 "$hdf_uhdf_path/config:libhdf_hcs", 130 "$hdf_uhdf_path/hcs:hdf_default.hcb", 131 "$hdf_uhdf_path/hdi:libhdi", 132 "$hdf_uhdf_path/host:hdf_devhost", 133 "$hdf_uhdf_path/host:libhdf_host", 134 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 135 "$hdf_uhdf_path/manager:hdf_devmgr", 136 "$hdf_uhdf_path/manager:hdf_devmgr.rc", 137 "$hdf_uhdf_path/osal:libhdf_utils", 138 "//utils/native/base:utils", 139 ] 140 141 defines = [] 142 if (enable_audio_device_mpi) { 143 defines += [ "AUDIO_HAL_USER" ] 144 } 145 146 if (is_standard_system) { 147 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 148 } else { 149 external_deps = [ "hilog:libhilog" ] 150 } 151 152 install_enable = true 153 subsystem_name = "hdf" 154 } 155 156 ohos_executable("audio_sample_capture") { 157 include_dirs = [ 158 "//drivers/peripheral/audio/interfaces/include", 159 "//drivers/peripheral/audio/hal/hdi_binder/proxy/include", 160 "//utils/native/base/include", 161 "$hdf_framework_path/include", 162 "$hdf_framework_path/include/osal", 163 "$hdf_framework_path/include/utils", 164 "$hdf_framework_path/utils/include", 165 "$hdf_framework_path/ability/sbuf/include", 166 "$hdf_framework_path/core/adapter/syscall/include", 167 "$hdf_framework_path/core/adapter/vnode/include", 168 "$hdf_framework_path/core/shared/include", 169 "$hdf_framework_path/include/core/", 170 "$hdf_uhdf_path/osal/include", 171 "$hdf_uhdf_path/include/hdi", 172 "$hdf_uhdf_path/ipc/include", 173 "$hdf_uhdf_path/include/config", 174 "$hdf_uhdf_path/include/osal", 175 "$hdf_uhdf_path/include/host", 176 "$hdf_uhdf_path/shared/include", 177 "$hdf_uhdf_path/manager/include", 178 "$hdf_uhdf_path/host/include", 179 "$hdf_uhdf_path/include", 180 "$hdf_uhdf_path/common/security/include", 181 ] 182 183 sources = [ "framework_capture.c" ] 184 185 deps = [ 186 "$hdf_uhdf_path/config:libhdf_hcs", 187 "$hdf_uhdf_path/hcs:hdf_default.hcb", 188 "$hdf_uhdf_path/hdi:libhdi", 189 "$hdf_uhdf_path/host:hdf_devhost", 190 "$hdf_uhdf_path/host:libhdf_host", 191 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 192 "$hdf_uhdf_path/manager:hdf_devmgr", 193 "$hdf_uhdf_path/manager:hdf_devmgr.rc", 194 "$hdf_uhdf_path/osal:libhdf_utils", 195 "//utils/native/base:utils", 196 ] 197 198 defines = [] 199 if (enable_audio_device_mpi) { 200 defines += [ "AUDIO_HAL_USER" ] 201 } 202 203 if (is_standard_system) { 204 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 205 } else { 206 external_deps = [ "hilog:libhilog" ] 207 } 208 209 install_enable = true 210 subsystem_name = "hdf" 211 } 212} 213