• 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      "//base/hiviewdfx/hilog_lite/interfaces/native/kits/",
32      "$hdf_hdi_service_path/vendor_interface/utils",
33    ]
34
35    public_deps = [ "drivers_interface_audio:libaudio_proxy_5.0" ]
36    external_deps = [
37      "bounds_checking_function:libsec_shared",
38      "hdf_core:libhdf_utils",
39      "hilog_lite:hilog_shared",
40    ]
41    subsystem_name = "hdf"
42    part_name = "drivers_peripheral_audio"
43  }
44
45  ohos_shared_library("audio_render_adapter") {
46    sources = [
47      "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
48      "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_render.c",
49      "$hdf_hdi_service_path/primary_impl/src/audio_common.c",
50    ]
51
52    public_deps = [ "drivers_interface_audio:libaudio_proxy_5.0" ]
53
54    include_dirs = [
55      "$hdf_hdi_service_path/primary_impl/include",
56      "$hdf_audio_path/supportlibs/adm_adapter/include",
57      "$hdf_audio_path/supportlibs/interfaces/include",
58      "//base/hiviewdfx/hilog_lite/interfaces/native/kits/",
59      "$hdf_hdi_service_path/vendor_interface/utils",
60    ]
61
62    external_deps = [
63      "bounds_checking_function:libsec_shared",
64      "hilog_lite:hilog_shared",
65    ]
66    if (enable_audio_hal_hdf_log) {
67      defines = [ "AUDIO_HDF_LOG" ]
68    }
69    subsystem_name = "hdf"
70    part_name = "drivers_peripheral_audio"
71  }
72} else {
73  ohos_shared_library("audio_capture_adapter") {
74    sources = [ "$hdf_hdi_service_path/primary_impl/src/audio_common.c" ]
75    if (drivers_peripheral_audio_feature_alsa_lib) {
76      sources += [
77        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_capture.c",
78        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_snd_capture.c",
79        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_soundcard.c",
80      ]
81      if (defined(is_emulator) && is_emulator) {
82        sources +=
83            [ "$hdf_audio_path/supportlibs/alsa_adapter/src/vendor_capture.c" ]
84      } else {
85        sources += [ "//device/board/${product_company}/${device_name}/audio_alsa/vendor_capture.c" ]
86      }
87    } else {
88      sources += [
89        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_capture.c",
90        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
91      ]
92    }
93    include_dirs = [
94      "$hdf_hdi_service_path/primary_impl/include",
95      "$hdf_audio_path/supportlibs/interfaces/include",
96      "$hdf_hdi_service_path/vendor_interface/utils",
97    ]
98
99    public_deps = []
100    if (drivers_peripheral_audio_feature_alsa_lib) {
101      include_dirs += [ "$hdf_audio_path/supportlibs/alsa_adapter/include" ]
102      if (!defined(is_emulator) || !is_emulator) {
103        include_dirs +=
104            [ "//device/board/${product_company}/${device_name}/audio_alsa" ]
105      }
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 (defined(is_emulator) && is_emulator) {
117      defines += [ "EMULATOR_ENABLED" ]
118    }
119
120    if (is_standard_system) {
121      external_deps = [
122        "drivers_interface_audio:libaudio_proxy_5.0",
123        "hdf_core:libhdf_utils",
124        "hilog:libhilog",
125      ]
126      if (enable_c_utils) {
127        external_deps += [ "c_utils:utils" ]
128      }
129    } else if (defined(ohos_lite)) {
130      external_deps = [ "hilog_lite:hilog_shared" ]
131    } else {
132      external_deps = [ "hilog:libhilog" ]
133    }
134    external_deps += [ "bounds_checking_function:libsec_shared" ]
135    if (drivers_peripheral_audio_feature_alsa_lib) {
136      external_deps += [
137        "alsa-lib:libasound",
138        "cJSON:cjson",
139      ]
140    }
141
142    install_images = [ chipset_base_dir ]
143    subsystem_name = "hdf"
144    part_name = "drivers_peripheral_audio"
145  }
146
147  ohos_shared_library("audio_render_adapter") {
148    sources = [ "$hdf_hdi_service_path/primary_impl/src/audio_common.c" ]
149    if (drivers_peripheral_audio_feature_alsa_lib) {
150      sources += [
151        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_render.c",
152        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_snd_render.c",
153        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_soundcard.c",
154      ]
155      if (defined(is_emulator) && is_emulator) {
156        sources +=
157            [ "$hdf_audio_path/supportlibs/alsa_adapter/src/vendor_render.c" ]
158      } else {
159        sources += [ "//device/board/${product_company}/${device_name}/audio_alsa/vendor_render.c" ]
160      }
161    } else {
162      sources += [
163        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
164        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_render.c",
165      ]
166    }
167
168    include_dirs = [
169      "$hdf_hdi_service_path/primary_impl/include",
170      "$hdf_audio_path/supportlibs/interfaces/include",
171      "$hdf_hdi_service_path/vendor_interface/utils",
172    ]
173
174    public_deps = []
175    if (drivers_peripheral_audio_feature_alsa_lib) {
176      include_dirs += [ "$hdf_audio_path/supportlibs/alsa_adapter/include" ]
177      if (!defined(is_emulator) || !is_emulator) {
178        include_dirs +=
179            [ "//device/board/${product_company}/${device_name}/audio_alsa" ]
180      }
181    } else {
182      include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ]
183    }
184
185    defines = [ "AUDIO_HDI_SERVICE_MODE" ]
186
187    if (enable_audio_hal_hdf_log) {
188      defines += [ "AUDIO_HDF_LOG" ]
189    }
190
191    if (defined(is_emulator) && is_emulator) {
192      defines += [ "EMULATOR_ENABLED" ]
193    }
194
195    if (is_standard_system) {
196      external_deps = [
197        "drivers_interface_audio:libaudio_proxy_5.0",
198        "hdf_core:libhdf_utils",
199        "hilog:libhilog",
200      ]
201      if (enable_c_utils) {
202        external_deps += [ "c_utils:utils" ]
203      }
204    } else if (defined(ohos_lite)) {
205      external_deps = [ "hilog_lite:hilog_shared" ]
206    } else {
207      external_deps = [ "hilog:libhilog" ]
208    }
209    external_deps += [ "bounds_checking_function:libsec_shared" ]
210    if (drivers_peripheral_audio_feature_alsa_lib) {
211      external_deps += [
212        "alsa-lib:libasound",
213        "cJSON:cjson",
214      ]
215    }
216
217    install_images = [ chipset_base_dir ]
218    subsystem_name = "hdf"
219    part_name = "drivers_peripheral_audio"
220  }
221}
222