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
17config("audio_toneplayer_config") {
18  include_dirs = [
19    "include",
20    "../audiostream/include",
21    "../audioutils/include",
22    "../audiorenderer/include",
23    "../../../interfaces/inner_api/native/audiocommon/include",
24    "../../../interfaces/inner_api/native/audiomanager/include",
25    "../../../interfaces/inner_api/native/audiorenderer/include",
26    "../../../interfaces/inner_api/native/toneplayer/include",
27    "../../../services/audio_policy/include",
28    "../../../services/audio_service/client",
29    "../../../services/test",
30  ]
31
32  cflags = [
33    "-Wall",
34    "-Werror",
35  ]
36}
37
38if (!audio_framework_feature_dtmf_tone) {
39  group("audio_toneplayer") {
40    deps = []
41  }
42} else {
43  ohos_shared_library("audio_toneplayer") {
44    branch_protector_ret = "pac_ret"
45    sanitize = {
46      cfi = true
47      cfi_cross_dso = true
48      cfi_vcall_icall_only = true
49      debug = false
50    }
51    install_enable = true
52
53    configs = [ ":audio_toneplayer_config" ]
54
55    sources = [ "src/toneplayer_impl.cpp" ]
56
57    defines = [ "FEATURE_DTMF_TONE" ]
58
59    deps = [
60      "../../../services/audio_policy:audio_policy_client",
61      "../../../services/audio_service:audio_client",
62      "../audiorenderer:audio_renderer",
63      "../audioutils:audio_utils",
64    ]
65
66    public_configs = [ ":audio_external_library_config" ]
67
68    external_deps = [
69      "c_utils:utils",
70      "hilog:libhilog",
71      "ipc:ipc_single",
72      "pulseaudio:pulse",
73    ]
74
75    public_external_deps = [ "bounds_checking_function:libsec_shared" ]
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 = [
102      "hilog:libhilog",
103      "pulseaudio:pulse",
104    ]
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