1# Copyright (c) 2021 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_hal_path = "./../.."
16import("//build/ohos.gni")
17import("$hdf_audio_path/audio.gni")
18
19if (drivers_peripheral_audio_feature_hdf_proxy_stub == true) {
20  ohos_shared_library("hdi_audio_usb_server") {
21    include_dirs = [
22      "$hdf_audio_path/interfaces/include",
23      "$hdf_hal_path/hdi_passthrough/include",
24      "include",
25    ]
26
27    sources = [
28      "$hdf_hal_path/hdi_passthrough/src/audio_adapter_info_common.c",
29      "$hdf_hal_path/hdi_passthrough/src/audio_common.c",
30      "src/hdf_audio_events.c",
31      "src/hdf_audio_server_capture.c",
32      "src/hdf_audio_server_common.c",
33      "src/hdf_audio_server_manager.c",
34      "src/hdf_audio_server_render.c",
35      "src/hdf_audio_usb_server.c",
36    ]
37
38    if (is_standard_system) {
39      external_deps = [
40        "hdf_core:libhdf_host",
41        "hdf_core:libhdf_utils",
42        "hilog:libhilog",
43      ]
44      if (enable_c_utils) {
45        external_deps += [ "c_utils:utils" ]
46      }
47    } else if (defined(ohos_lite)) {
48      external_deps = [ "hilog_lite:hilog_shared" ]
49    } else {
50      external_deps = [ "hilog:libhilog" ]
51    }
52    external_deps += [ "bounds_checking_function:libsec_shared" ]
53    defines = []
54    if (enable_audio_hal_hdf_log) {
55      defines += [ "AUDIO_HDF_LOG" ]
56    }
57
58    shlib_type = "hdi"
59    install_images = [ chipset_base_dir ]
60    subsystem_name = "hdf"
61    part_name = "drivers_peripheral_audio"
62  }
63
64  ohos_shared_library("hdi_audio_a2dp_server") {
65    include_dirs = [
66      "$hdf_audio_path/interfaces/include",
67      "$hdf_hal_path/hdi_passthrough/include",
68      "include",
69    ]
70
71    sources = [
72      "$hdf_hal_path/hdi_passthrough/src/audio_adapter_info_common.c",
73      "$hdf_hal_path/hdi_passthrough/src/audio_common.c",
74      "src/hdf_audio_a2dp_server.c",
75      "src/hdf_audio_events.c",
76      "src/hdf_audio_server_capture.c",
77      "src/hdf_audio_server_common.c",
78      "src/hdf_audio_server_manager.c",
79      "src/hdf_audio_server_render.c",
80    ]
81
82    if (is_standard_system) {
83      external_deps = [
84        "hdf_core:libhdf_host",
85        "hdf_core:libhdf_utils",
86        "hilog:libhilog",
87      ]
88      if (enable_c_utils) {
89        external_deps += [ "c_utils:utils" ]
90      }
91    } else if (defined(ohos_lite)) {
92      external_deps = [ "hilog_lite:hilog_shared" ]
93    } else {
94      external_deps = [ "hilog:libhilog" ]
95    }
96    external_deps += [ "bounds_checking_function:libsec_shared" ]
97    defines = []
98    if (enable_audio_hal_hdf_log) {
99      defines += [ "AUDIO_HDF_LOG" ]
100    }
101
102    shlib_type = "hdi"
103    install_images = [ chipset_base_dir ]
104    subsystem_name = "hdf"
105    part_name = "drivers_peripheral_audio"
106  }
107}
108