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      "eventhandler:libeventhandler",
71      "hilog:libhilog",
72      "ipc:ipc_single",
73      "pulseaudio:pulse",
74    ]
75
76    public_external_deps = [ "bounds_checking_function:libsec_shared" ]
77
78    version_script = "../../../audio_framework.versionscript"
79    innerapi_tags = [ "platformsdk" ]
80
81    part_name = "audio_framework"
82    subsystem_name = "multimedia"
83  }
84}
85
86if (!audio_framework_feature_dtmf_tone) {
87  group("audio_toneplayer_test") {
88    deps = []
89  }
90} else {
91  ohos_executable("audio_toneplayer_test") {
92    install_enable = false
93
94    sources = [ "test/example/audio_toneplayer_test.cpp" ]
95
96    configs = [ ":audio_toneplayer_config" ]
97
98    defines = [ "FEATURE_DTMF_TONE" ]
99
100    deps = [ ":audio_toneplayer" ]
101
102    external_deps = [
103      "hilog:libhilog",
104      "pulseaudio:pulse",
105    ]
106
107    part_name = "audio_framework"
108    subsystem_name = "multimedia"
109  }
110}
111
112config("audio_external_library_config") {
113  include_dirs = [
114    "include",
115    "../../../interfaces/inner_api/native/toneplayer/include",
116  ]
117}
118