1# Copyright (c) 2023 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("//build/test.gni")
16import("./../../audio.gni")
17
18module_output_path = "drivers_peripheral_audio/audio"
19
20ohos_benchmarktest("hdf_audio_benchmark_test") {
21  module_out_path = module_output_path
22
23  include_dirs = []
24
25  sources = [
26    "adapter/audio_adapter_benchmarktest.cpp",
27    "capture/audio_capture_benchmarktest.cpp",
28    "capture/audio_capture_mmap_benchmarktest.cpp",
29    "manager/audio_manager_benchmarktest.cpp",
30    "render/audio_render_benchmarktest.cpp",
31    "render/audio_render_mmap_benchmarktest.cpp",
32  ]
33
34  if (drivers_peripheral_audio_feature_effect) {
35    sources += [
36      "effect/audio_effectcontrol_benchmarktest.cpp",
37      "effect/audio_effectmodel_benchmarktest.cpp",
38    ]
39  }
40
41  cflags = [
42    "-Wall",
43    "-Wextra",
44    "-Werror",
45    "-fsigned-char",
46    "-fno-common",
47    "-fno-strict-aliasing",
48  ]
49
50  deps = [
51    "//third_party/benchmark",
52    "//third_party/googletest:gtest_main",
53  ]
54
55  if (is_standard_system) {
56    external_deps = [
57      "drivers_interface_audio:libaudio_proxy_4.0",
58      "drivers_interface_audio:libeffect_proxy_1.0",
59      "hdf_core:libhdf_utils",
60      "hilog:libhilog",
61    ]
62    if (enable_c_utils) {
63      external_deps += [ "c_utils:utils" ]
64    }
65  } else if (defined(ohos_lite)) {
66    external_deps = [ "hilog_lite:hilog_shared" ]
67  } else {
68    external_deps = [ "hilog:libhilog" ]
69  }
70  external_deps += [
71    "bounds_checking_function:libsec_shared",
72    "ipc:ipc_single",
73  ]
74}
75