• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 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    "../audiodefinitions/include",
21    "../audiostream/include",
22    "../audioutils/include",
23    "../audiorenderer/include",
24    "../../../interfaces/inner_api/native/audiocommon/include",
25    "../../../interfaces/inner_api/native/audiomanager/include",
26    "../../../interfaces/inner_api/native/audiorenderer/include",
27    "../../../interfaces/inner_api/native/toneplayer/include",
28    "../../../services/audio_policy/include",
29    "../../../services/audio_service/client",
30    "../../../services/test",
31  ]
32
33  cflags = [
34    "-Wall",
35    "-Werror",
36  ]
37}
38
39if (!audio_framework_feature_dtmf_tone) {
40  group("audio_toneplayer") {
41    deps = []
42  }
43} else {
44  ohos_shared_library("audio_toneplayer") {
45    branch_protector_ret = "pac_ret"
46    sanitize = {
47      cfi = true
48      cfi_cross_dso = true
49      cfi_vcall_icall_only = true
50      debug = false
51      integer_overflow = true
52      ubsan = true
53      boundary_sanitize = true
54    }
55    install_enable = true
56
57    configs = [ ":audio_toneplayer_config" ]
58
59    sources = [ "src/toneplayer_impl.cpp" ]
60
61    defines = [ "FEATURE_DTMF_TONE" ]
62
63    deps = [
64      "../../../services/audio_service:audio_common",
65      "../../../services/audio_policy:audio_policy_client",
66      "../audiorenderer:audio_renderer",
67      "../audioutils:audio_utils",
68    ]
69
70    public_configs = [ ":audio_external_library_config" ]
71
72    external_deps = [
73      "c_utils:utils",
74      "eventhandler:libeventhandler",
75      "hilog:libhilog",
76      "init:libbegetutil",
77      "ipc:ipc_single",
78    ]
79
80    if (audio_telephony_core_service_enable) {
81      external_deps += [ "core_service:tel_core_service_api" ]
82      defines += [ "AUDIO_TEL_CORE_SERVICE_ENABLE" ]
83    }
84
85    if (audio_telephony_cellular_data_enable) {
86      external_deps += [ "cellular_data:tel_cellular_data_api" ]
87      defines += [ "AUIDO_TEL_CELLULAR_DATA_ENABLE" ]
88    }
89
90    public_external_deps = [ "bounds_checking_function:libsec_shared" ]
91
92    version_script = "../../../audio_framework.versionscript"
93    innerapi_tags = [ "platformsdk" ]
94
95    part_name = "audio_framework"
96    subsystem_name = "multimedia"
97  }
98}
99
100if (!audio_framework_feature_dtmf_tone) {
101  group("audio_toneplayer_test") {
102    deps = []
103  }
104} else {
105  ohos_executable("audio_toneplayer_test") {
106    install_enable = false
107
108    sources = [ "test/example/audio_toneplayer_test.cpp" ]
109
110    configs = [ ":audio_toneplayer_config" ]
111
112    defines = [ "FEATURE_DTMF_TONE" ]
113
114    deps = [ ":audio_toneplayer" ]
115
116    external_deps = [
117      "c_utils:utils",
118      "hilog:libhilog",
119    ]
120
121    part_name = "audio_framework"
122    subsystem_name = "multimedia"
123  }
124}
125
126config("audio_external_library_config") {
127  include_dirs = [
128    "include",
129    "../../../interfaces/inner_api/native/toneplayer/include",
130  ]
131}
132