• 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_featured_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_featured_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_lib_common.c",
80        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_mixer_path.c",
81        "//third_party/cJSON/cJSON.c",
82      ]
83    } else {
84      sources += [
85        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_capture.c",
86        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
87      ]
88    }
89    include_dirs = [
90      "$hdf_hdi_service_path/primary_impl/include",
91      "$hdf_audio_path/supportlibs/interfaces/include",
92      "//third_party/bounds_checking_function/include",
93      "$hdf_hdi_service_path/vendor_interface/utils",
94    ]
95
96    public_deps = []
97    if (drivers_peripheral_audio_feature_alsa_lib) {
98      include_dirs += [
99        "//third_party/cJSON",
100        "//third_party/alsa-lib/include",
101        "$hdf_audio_path/supportlibs/alsa_adapter/include",
102      ]
103      public_deps += [ "//third_party/alsa-lib:libasound" ]
104    } else {
105      include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ]
106    }
107
108    defines = [ "AUDIO_HDI_SERVICE_MODE" ]
109
110    if (enable_audio_hal_hdf_log) {
111      defines += [ "AUDIO_HDF_LOG" ]
112    }
113
114    if (is_standard_system) {
115      external_deps = [
116        "c_utils:utils",
117        "drivers_interface_audio:audio_idl_headers",
118        "hdf_core:libhdf_utils",
119        "hilog:libhilog",
120      ]
121    } else {
122      external_deps = [ "hilog:libhilog" ]
123    }
124
125    install_images = [ chipset_base_dir ]
126    subsystem_name = "hdf"
127    part_name = "drivers_peripheral_audio"
128  }
129
130  ohos_shared_library("audio_render_adapter") {
131    sources = [ "$hdf_hdi_service_path/primary_impl/src/audio_common.c" ]
132    if (drivers_peripheral_audio_feature_alsa_lib) {
133      sources += [
134        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_common.c",
135        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_lib_render.c",
136        "$hdf_audio_path/supportlibs/alsa_adapter/src/alsa_mixer_path.c",
137        "//third_party/cJSON/cJSON.c",
138      ]
139    } else {
140      sources += [
141        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_common.c",
142        "$hdf_audio_path/supportlibs/adm_adapter/src/audio_interface_lib_render.c",
143      ]
144    }
145
146    include_dirs = [
147      "$hdf_hdi_service_path/primary_impl/include",
148      "$hdf_audio_path/supportlibs/interfaces/include",
149      "//third_party/bounds_checking_function/include",
150      "$hdf_hdi_service_path/vendor_interface/utils",
151    ]
152
153    public_deps = []
154    if (drivers_peripheral_audio_feature_alsa_lib) {
155      include_dirs += [
156        "//third_party/cJSON",
157        "//third_party/alsa-lib/include",
158        "$hdf_audio_path/supportlibs/alsa_adapter/include",
159      ]
160      public_deps += [ "//third_party/alsa-lib:libasound" ]
161    } else {
162      include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ]
163    }
164
165    defines = [ "AUDIO_HDI_SERVICE_MODE" ]
166
167    if (enable_audio_hal_hdf_log) {
168      defines += [ "AUDIO_HDF_LOG" ]
169    }
170
171    if (is_standard_system) {
172      external_deps = [
173        "c_utils:utils",
174        "drivers_interface_audio:audio_idl_headers",
175        "hdf_core:libhdf_utils",
176        "hilog:libhilog",
177      ]
178    } else {
179      external_deps = [ "hilog:libhilog" ]
180    }
181
182    install_images = [ chipset_base_dir ]
183    subsystem_name = "hdf"
184    part_name = "drivers_peripheral_audio"
185  }
186}
187