1# Copyright (c) 2022-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
14hdf_audio_path = "./../.."
15hdf_hdi_service_path = "./.."
16import("//build/ohos.gni")
17import("$hdf_audio_path/audio.gni")
18
19ohos_shared_library("audio_primary_impl_vendor") {
20  defines = []
21  if (drivers_peripheral_audio_feature_community) {
22    sources = [
23      "src/audio_adapter.c",
24      "src/audio_adapter_info_common.c",
25      "src/audio_capture.c",
26      "src/audio_common.c",
27      "src/audio_manager.c",
28      "src/audio_render.c",
29    ]
30
31    include_dirs = [
32      "include",
33      "$hdf_hdi_service_path/pathselect/include",
34      "$hdf_audio_path/supportlibs/adm_adapter/include",
35      "$hdf_audio_path/supportlibs/interfaces/include",
36      "$hdf_hdi_service_path/vendor_interface/utils",
37    ]
38
39    if (drivers_peripheral_audio_feature_hal_notsupport_pathselect) {
40      defines += [ "AUDIO_HAL_NOTSUPPORT_PATHSELECT" ]
41    }
42  } else {
43    sources = [
44      "vdi_src/audio_adapter_vdi.c",
45      "vdi_src/audio_capture_vdi.c",
46      "vdi_src/audio_common_vdi.c",
47      "vdi_src/audio_dfx_vdi.cpp",
48      "vdi_src/audio_manager_vdi.c",
49      "vdi_src/audio_render_vdi.c",
50    ]
51
52    include_dirs = [
53      "$hdf_audio_path/interfaces/sound/v1_0",
54      "$hdf_hdi_service_path/vendor_interface/utils",
55    ]
56  }
57
58  if (enable_audio_hal_hdf_log) {
59    defines += [ "AUDIO_HDF_LOG" ]
60  }
61
62  if (musl_use_jemalloc && musl_use_jemalloc_dfx_intf) {
63    defines += [ "CONFIG_USE_JEMALLOC_DFX_INTF" ]
64  }
65
66  if (is_standard_system) {
67    external_deps = [
68      "drivers_interface_audio:libaudio_proxy_4.0",
69      "hdf_core:libhdf_ipc_adapter",
70      "hdf_core:libhdi",
71      "hdf_core:libpub_utils",
72      "hilog:libhilog",
73    ]
74    if (enable_c_utils) {
75      external_deps += [ "c_utils:utils" ]
76    }
77  } else if (defined(ohos_lite)) {
78    external_deps = [ "hilog_lite:hilog_shared" ]
79  } else {
80    external_deps = [ "hilog:libhilog" ]
81  }
82
83  external_deps += [
84    "bounds_checking_function:libsec_shared",
85    "hitrace:hitrace_meter",
86  ]
87
88  if (drivers_peripheral_audio_feature_hicollie_enable) {
89    external_deps += [ "hicollie:libhicollie" ]
90    defines += [ "AUDIO_HICOLLIE_ENABLE" ]
91  }
92
93  install_images = [ chipset_base_dir ]
94  subsystem_name = "hdf"
95  part_name = "drivers_peripheral_audio"
96}
97