1# Copyright (c) 2023-2025 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("../../../config.gni") 16 17config("audio_config") { 18 include_dirs = [ 19 "../audiocapturer/include", 20 "../audiorenderer/include", 21 "../audioutils/include/", 22 "../../../interfaces/inner_api/native/audiocommon/include", 23 "../../../interfaces/inner_api/native/audiocapturer/include", 24 "../../../interfaces/inner_api/native/audiomanager/include", 25 "../../../interfaces/inner_api/native/audiorenderer/include", 26 "../../../interfaces/inner_api/native/audiostream/include", 27 "../../../services/audio_service/client/include", 28 ] 29 30 cflags = [ 31 "-Wall", 32 "-Werror", 33 ] 34} 35 36ohos_shared_library("ohaudio") { 37 sanitize = { 38 cfi = true 39 cfi_cross_dso = true 40 cfi_vcall_icall_only = true 41 debug = false 42 integer_overflow = true 43 ubsan = true 44 boundary_sanitize = true 45 } 46 include_dirs = [ 47 "../../../interfaces/kits/c/", 48 "../../../interfaces/kits/c/common/", 49 "../../../interfaces/kits/c/audio_renderer/", 50 "../../../interfaces/kits/c/audio_capturer/", 51 "../../../interfaces/kits/c/audio_manager/", 52 "../../native/audiopolicy/include/", 53 ] 54 55 configs = [ ":audio_config" ] 56 57 sources = [ 58 "./OHAudioCapturer.cpp", 59 "./OHAudioCommon.cpp", 60 "./OHAudioDeviceDescriptor.cpp", 61 "./OHAudioManager.cpp", 62 "./OHAudioRenderer.cpp", 63 "./OHAudioRoutingManager.cpp", 64 "./OHAudioSessionManager.cpp", 65 "./OHAudioStreamBuilder.cpp", 66 "./OHAudioStreamManager.cpp", 67 "./OHAudioVolumeManager.cpp", 68 "./OHAudioWorkgroup.cpp", 69 "./OHAudioResourceManager.cpp", 70 ] 71 72 deps = [ 73 "../../../services/audio_service:audio_client", 74 "../audiocapturer:audio_capturer", 75 "../audiorenderer:audio_renderer", 76 ] 77 cflags = [ "-Werror" ] 78 79 external_deps = [ 80 "c_utils:utils", 81 "hilog:libhilog", 82 "init:libbegetutil", 83 "ipc:ipc_single" 84 ] 85 86 innerapi_tags = [ "ndk" ] 87 88 output_name = "ohaudio" 89 output_extension = "so" 90 subsystem_name = "multimedia" 91 part_name = "audio_framework" 92} 93 94group("oh_audio_renderer_test_packages") { 95 deps = [ 96 ":oh_audio_capturer_test", 97 ":oh_audio_renderer_test", 98 ":oh_audio_session_manager_test", 99 ] 100} 101 102ohos_executable("oh_audio_capturer_test") { 103 install_enable = false 104 105 include_dirs = [ 106 "../../../interfaces/kits/c/", 107 "../../../interfaces/kits/c/common/", 108 "../../../interfaces/kits/c/audio_renderer/", 109 "../../../interfaces/kits/c/audio_capturer/", 110 ] 111 112 sources = [ "test/example/oh_audio_capturer_test.cpp" ] 113 114 configs = [ ":audio_config" ] 115 116 deps = [ ":ohaudio" ] 117 118 external_deps = [ "hilog:libhilog" ] 119 120 part_name = "audio_framework" 121 subsystem_name = "multimedia" 122} 123 124ohos_executable("oh_audio_capturer_lowlatency_test") { 125 install_enable = false 126 127 include_dirs = [ 128 "../../../interfaces/kits/c/", 129 "../../../interfaces/kits/c/common/", 130 "../../../interfaces/kits/c/audio_renderer/", 131 "../../../interfaces/kits/c/audio_capturer/", 132 "../audioutils/include", 133 "../../../interfaces/inner_api/native/audiocommon/include", 134 "../../../interfaces/inner_api/native/audiomanager/include", 135 "../../../services/audio_service/client/include", 136 ] 137 138 sources = [ "test/example/oh_audio_capturer_lowlatency_test.cpp" ] 139 140 configs = [ ":audio_config" ] 141 142 deps = [ 143 ":ohaudio", 144 "../audioutils:audio_utils", 145 ] 146 147 external_deps = [ 148 "bounds_checking_function:libsec_shared", 149 "c_utils:utils", 150 "hilog:libhilog", 151 "init:libbegetutil", 152 ] 153 154 part_name = "audio_framework" 155 subsystem_name = "multimedia" 156} 157 158ohos_executable("oh_audio_renderer_test") { 159 install_enable = false 160 161 include_dirs = [ 162 "../../../interfaces/kits/c/", 163 "../../../interfaces/kits/c/common/", 164 "../../../interfaces/kits/c/audio_renderer/", 165 "../../../interfaces/kits/c/audio_capturer/", 166 ] 167 168 sources = [ "test/example/oh_audio_renderer_test.cpp" ] 169 170 configs = [ ":audio_config" ] 171 172 deps = [ ":ohaudio" ] 173 174 external_deps = [ "hilog:libhilog" ] 175 176 part_name = "audio_framework" 177 subsystem_name = "multimedia" 178} 179 180ohos_executable("oh_audio_session_manager_test") { 181 stack_protector_ret = true 182 183 sanitize = { 184 cfi = true 185 cfi_cross_dso = true 186 cfi_vcall_icall_only = true 187 debug = false 188 integer_overflow = true 189 ubsan = true 190 boundary_sanitize = true 191 } 192 193 install_enable = false 194 195 include_dirs = [ 196 "../../../interfaces/kits/c/", 197 "../../../interfaces/kits/c/audio_manager/", 198 "../../../interfaces/kits/c/common/", 199 "../../../interfaces/kits/c/audio_renderer/", 200 ] 201 202 sources = [ "test/example/oh_audio_session_manager_test.cpp" ] 203 204 configs = [ ":audio_config" ] 205 206 deps = [ 207 ":ohaudio", 208 "../audioutils:audio_utils", 209 ] 210 211 external_deps = [ 212 "bounds_checking_function:libsec_shared", 213 "c_utils:utils", 214 "hilog:libhilog", 215 "init:libbegetutil", 216 ] 217 218 part_name = "audio_framework" 219 subsystem_name = "multimedia" 220} 221