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 = [ 59 "src/toneplayer.cpp", 60 "src/toneplayer_impl.cpp", 61 ] 62 63 defines = [ "FEATURE_DTMF_TONE" ] 64 65 deps = [ 66 "../../../services/audio_policy:audio_policy_client", 67 "../../../services/audio_service:audio_client", 68 "../audiorenderer:audio_renderer", 69 "../audioutils:audio_utils", 70 ] 71 72 public_configs = [ ":audio_external_library_config" ] 73 74 external_deps = [ 75 "c_utils:utils", 76 "hilog:libhilog", 77 "ipc:ipc_single", 78 ] 79 80 version_script = "../../../audio_framework.versionscript" 81 innerapi_tags = [ "platformsdk" ] 82 83 part_name = "audio_framework" 84 subsystem_name = "multimedia" 85 } 86} 87 88if (!audio_framework_feature_dtmf_tone) { 89 group("audio_toneplayer_test") { 90 deps = [] 91 } 92} else { 93 ohos_executable("audio_toneplayer_test") { 94 install_enable = false 95 96 sources = [ "test/example/audio_toneplayer_test.cpp" ] 97 98 configs = [ ":audio_toneplayer_config" ] 99 100 defines = [ "FEATURE_DTMF_TONE" ] 101 102 deps = [ ":audio_toneplayer" ] 103 104 external_deps = [ "hilog:libhilog" ] 105 106 part_name = "audio_framework" 107 subsystem_name = "multimedia" 108 } 109} 110 111config("audio_external_library_config") { 112 include_dirs = [ 113 "include", 114 "../../../interfaces/inner_api/native/toneplayer/include", 115 ] 116} 117