• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
19if (defined(ohos_lite)) {
20  ohos_shared_library("audio_capture_adapter") {
21    sources = [
22      "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_capture.c",
23      "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
24      "$hdf_hdi_service_path/primary_impl/src/audio_common.c",
25    ]
26
27    include_dirs = [
28      "$hdf_hdi_service_path/primary_impl/include",
29      "$hdf_audio_path/supportlibs/adm_adapter/include",
30      "$hdf_audio_path/supportlibs/interfaces/include",
31      "//third_party/bounds_checking_function/include",
32      "//base/hiviewdfx/hilog_lite/interfaces/native/kits/",
33      "$hdf_hdi_service_path/vendor_interface/utils",
34    ]
35
36    public_deps = [ "drivers_interface_audio:audio_idl_headers" ]
37    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
38    external_deps = [
39      "hdf_core:libhdf_utils",
40      "hilog_lite:hilog_shared",
41    ]
42    subsystem_name = "hdf"
43    part_name = "drivers_peripheral_audio"
44  }
45
46  ohos_shared_library("audio_render_adapter") {
47    sources = [
48      "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
49      "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_render.c",
50      "$hdf_hdi_service_path/primary_impl/src/audio_common.c",
51    ]
52
53    public_deps = [ "drivers_interface_audio:audio_idl_headers" ]
54
55    include_dirs = [
56      "$hdf_hdi_service_path/primary_impl/include",
57      "$hdf_audio_path/supportlibs/adm_adapter/include",
58      "$hdf_audio_path/supportlibs/interfaces/include",
59      "//third_party/bounds_checking_function/include",
60      "//base/hiviewdfx/hilog_lite/interfaces/native/kits/",
61      "$hdf_hdi_service_path/vendor_interface/utils",
62    ]
63
64    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
65
66    external_deps = [ "hilog_lite:hilog_shared" ]
67    if (enable_audio_hal_hdf_log) {
68      defines = [ "AUDIO_HDF_LOG" ]
69    }
70    subsystem_name = "hdf"
71    part_name = "drivers_peripheral_audio"
72  }
73} else {
74  ohos_shared_library("audio_capture_adapter") {
75    sources = [ "$hdf_hdi_service_path/primary_impl/src/audio_common.c" ]
76    if (drivers_peripheral_audio_feature_alsa_lib) {
77      sources += [
78        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_capture.c",
79        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_snd_capture.c",
80        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_soundcard.c",
81        "//device/board/${product_company}/${device_name}/audio_alsa/vendor_capture.c",
82        "//third_party/cJSON/cJSON.c",
83      ]
84    } else {
85      sources += [
86        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_capture.c",
87        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
88      ]
89    }
90    include_dirs = [
91      "$hdf_hdi_service_path/primary_impl/include",
92      "$hdf_audio_path/supportlibs/interfaces/include",
93      "//third_party/bounds_checking_function/include",
94      "$hdf_hdi_service_path/vendor_interface/utils",
95    ]
96
97    public_deps = []
98    if (drivers_peripheral_audio_feature_alsa_lib) {
99      include_dirs += [
100        "//third_party/cJSON",
101        "//third_party/alsa-lib/include",
102        "$hdf_audio_path/supportlibs/alsa_adapter/include",
103        "//device/board/${product_company}/${device_name}/audio_alsa",
104      ]
105      public_deps += [ "//third_party/alsa-lib:libasound" ]
106    } else {
107      include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ]
108    }
109
110    defines = [ "AUDIO_HDI_SERVICE_MODE" ]
111
112    if (enable_audio_hal_hdf_log) {
113      defines += [ "AUDIO_HDF_LOG" ]
114    }
115
116    if (is_standard_system) {
117      external_deps = [
118        "c_utils:utils",
119        "drivers_interface_audio:audio_idl_headers",
120        "hdf_core:libhdf_utils",
121        "hilog:libhilog",
122      ]
123    } else {
124      external_deps = [ "hilog:libhilog" ]
125    }
126
127    install_images = [ chipset_base_dir ]
128    subsystem_name = "hdf"
129    part_name = "drivers_peripheral_audio"
130  }
131
132  ohos_shared_library("audio_render_adapter") {
133    sources = [ "$hdf_hdi_service_path/primary_impl/src/audio_common.c" ]
134    if (drivers_peripheral_audio_feature_alsa_lib) {
135      sources += [
136        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_render.c",
137        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_snd_render.c",
138        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_soundcard.c",
139        "//device/board/${product_company}/${device_name}/audio_alsa/vendor_render.c",
140        "//third_party/cJSON/cJSON.c",
141      ]
142    } else {
143      sources += [
144        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
145        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_render.c",
146      ]
147    }
148
149    include_dirs = [
150      "$hdf_hdi_service_path/primary_impl/include",
151      "$hdf_audio_path/supportlibs/interfaces/include",
152      "//third_party/bounds_checking_function/include",
153      "$hdf_hdi_service_path/vendor_interface/utils",
154    ]
155
156    public_deps = []
157    if (drivers_peripheral_audio_feature_alsa_lib) {
158      include_dirs += [
159        "//third_party/cJSON",
160        "//third_party/alsa-lib/include",
161        "$hdf_audio_path/supportlibs/alsa_adapter/include",
162        "//device/board/${product_company}/${device_name}/audio_alsa",
163      ]
164      public_deps += [ "//third_party/alsa-lib:libasound" ]
165    } else {
166      include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ]
167    }
168
169    defines = [ "AUDIO_HDI_SERVICE_MODE" ]
170
171    if (enable_audio_hal_hdf_log) {
172      defines += [ "AUDIO_HDF_LOG" ]
173    }
174
175    if (is_standard_system) {
176      external_deps = [
177        "c_utils:utils",
178        "drivers_interface_audio:audio_idl_headers",
179        "hdf_core:libhdf_utils",
180        "hilog:libhilog",
181      ]
182    } else {
183      external_deps = [ "hilog:libhilog" ]
184    }
185
186    install_images = [ chipset_base_dir ]
187    subsystem_name = "hdf"
188    part_name = "drivers_peripheral_audio"
189  }
190}
191