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") 15 16pulseaudio_dir = "//third_party/pulseaudio" 17 18config("audio_toneplayer_config") { 19 include_dirs = [ 20 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiorenderer/include", 21 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/toneplayer/include", 22 "//foundation/multimedia/audio_framework/frameworks/native/audiorenderer/include", 23 "//foundation/multimedia/audio_framework/frameworks/native/toneplayer/include", 24 "//foundation/multimedia/audio_framework/frameworks/native/audiostream/include", 25 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiocommon/include", 26 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/audiomanager/include", 27 "//foundation/multimedia/audio_framework/services/audio_policy/include", 28 "//foundation/multimedia/audio_framework/services/audio_service/client", 29 "//foundation/multimedia/audio_framework/services/test", 30 "//commonlibrary/c_utils/base/include", 31 "$pulseaudio_dir/src", 32 "$pulseaudio_dir/confgure/src", 33 ] 34 35 cflags = [ 36 "-Wall", 37 "-Werror", 38 ] 39} 40 41ohos_shared_library("audio_toneplayer") { 42 sanitize = { 43 cfi = true 44 debug = false 45 blocklist = "//foundation/multimedia/audio_framework/cfi_blocklist.txt" 46 } 47 install_enable = true 48 49 configs = [ ":audio_toneplayer_config" ] 50 51 sources = [ "src/toneplayer.cpp" ] 52 53 deps = [ 54 "//foundation/multimedia/audio_framework/frameworks/native/audiorenderer:audio_renderer", 55 "//foundation/multimedia/audio_framework/services/audio_policy:audio_policy_client", 56 "//foundation/multimedia/audio_framework/services/audio_service:audio_client", 57 ] 58 59 public_configs = [ ":audio_external_library_config" ] 60 61 external_deps = [ 62 "c_utils:utils", 63 "hiviewdfx_hilog_native:libhilog", 64 ] 65 66 part_name = "multimedia_audio_framework" 67 subsystem_name = "multimedia" 68} 69 70ohos_executable("audio_toneplayer_test") { 71 install_enable = false 72 73 sources = [ "test/example/audio_toneplayer_test.cpp" ] 74 75 configs = [ ":audio_toneplayer_config" ] 76 77 deps = [ ":audio_toneplayer" ] 78 79 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 80 81 part_name = "multimedia_audio_framework" 82 subsystem_name = "multimedia" 83} 84 85config("audio_external_library_config") { 86 include_dirs = [ 87 "//foundation/multimedia/audio_framework/interfaces/inner_api/native/toneplayer/include", 88 "//foundation/multimedia/audio_framework/frameworks/native/toneplayer/include", 89 ] 90} 91