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("../../../config.gni") 16 17pulseaudio_dir = "//third_party/pulseaudio" 18 19config("audio_toneplayer_config") { 20 include_dirs = [ 21 "include", 22 "../audiostream/include", 23 "../audioutils/include", 24 "../audiorenderer/include", 25 "../../../interfaces/inner_api/native/audiocommon/include", 26 "../../../interfaces/inner_api/native/audiomanager/include", 27 "../../../interfaces/inner_api/native/audiorenderer/include", 28 "../../../interfaces/inner_api/native/toneplayer/include", 29 "../../../services/audio_policy/include", 30 "../../../services/audio_service/client", 31 "../../../services/test", 32 "$pulseaudio_dir/src", 33 "$pulseaudio_dir/confgure/src", 34 ] 35 36 cflags = [ 37 "-Wall", 38 "-Werror", 39 ] 40} 41 42if (!audio_framework_feature_dtmf_tone) { 43 group("audio_toneplayer") { 44 deps = [] 45 } 46} else { 47 ohos_shared_library("audio_toneplayer") { 48 sanitize = { 49 cfi = true 50 cfi_cross_dso = true 51 debug = false 52 blocklist = "../../../cfi_blocklist.txt" 53 } 54 install_enable = true 55 56 configs = [ ":audio_toneplayer_config" ] 57 58 sources = [ "src/toneplayer.cpp" ] 59 60 defines = [ "FEATURE_DTMF_TONE" ] 61 62 deps = [ 63 "../../../services/audio_policy:audio_policy_client", 64 "../../../services/audio_service:audio_client", 65 "../audiorenderer:audio_renderer", 66 "../audioutils:audio_utils", 67 ] 68 69 public_configs = [ ":audio_external_library_config" ] 70 71 external_deps = [ 72 "c_utils:utils", 73 "hilog:libhilog", 74 "ipc:ipc_single", 75 ] 76 77 version_script = "../../../audio_framework.versionscript" 78 innerapi_tags = [ "platformsdk" ] 79 80 part_name = "audio_framework" 81 subsystem_name = "multimedia" 82 } 83} 84 85if (!audio_framework_feature_dtmf_tone) { 86 group("audio_toneplayer_test") { 87 deps = [] 88 } 89} else { 90 ohos_executable("audio_toneplayer_test") { 91 install_enable = false 92 93 sources = [ "test/example/audio_toneplayer_test.cpp" ] 94 95 configs = [ ":audio_toneplayer_config" ] 96 97 defines = [ "FEATURE_DTMF_TONE" ] 98 99 deps = [ ":audio_toneplayer" ] 100 101 external_deps = [ "hilog:libhilog" ] 102 103 part_name = "audio_framework" 104 subsystem_name = "multimedia" 105 } 106} 107 108config("audio_external_library_config") { 109 include_dirs = [ 110 "include", 111 "../../../interfaces/inner_api/native/toneplayer/include", 112 ] 113} 114