• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14import("//build/ohos.gni")
15import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
16import("//drivers/peripheral/audio/audio.gni")
17
18declare_args() {
19  drivers_peripheral_bluetooth_a2dp_hdi = false
20}
21
22config("hdi_audio_config") {
23  visibility = [ ":*" ]
24
25  cflags = [
26    "-fPIC",
27    "-Wall",
28    "-Wextra",
29    "-Werror",
30    "-DGST_DISABLE_DEPRECATED",
31    "-DHAVE_CONFIG_H",
32    "-fno-strict-aliasing",
33    "-Wno-builtin-requires-header",
34    "-Wno-int-conversion",
35    "-Wno-unused-parameter",
36    "-Wno-thread-safety-attributes",
37    "-Wno-inconsistent-missing-override",
38    "-fno-rtti",
39    "-fno-exceptions",
40    "-ffunction-sections",
41    "-fdata-sections",
42    "-Oz",
43    "-flto",
44  ]
45
46  ldflags = [ "-Wl" ]
47}
48
49ohos_shared_library("hdi_audio_bluetooth") {
50  if (drivers_peripheral_bluetooth_a2dp_hdi) {
51    defines = [ "A2DP_HDI_SERVICE" ]
52  }
53
54  sources = [
55    "//third_party/cJSON/cJSON.c",
56    "src/audio_adapter.cpp",
57    "src/audio_adapter_info_common.cpp",
58    "src/audio_bluetooth_manager.cpp",
59    "src/audio_common.cpp",
60    "src/audio_manager.cpp",
61    "src/audio_render.cpp",
62    "src/bluetooth_a2dp_audio_src_observer_stub.cpp",
63    "src/bluetooth_a2dp_src_observer.cpp",
64    "src/fast_audio_render.cpp",
65    "src/audio_capture.cpp",
66  ]
67
68  include_dirs = [
69    "//drivers/peripheral/bluetooth/audio/hal/hdi_passthrough/include",
70    "//drivers/peripheral/bluetooth/audio/supportlibs/adm_adapter/include",
71    "//third_party/cJSON",
72    "//drivers/peripheral/bluetooth/audio/interfaces/include",
73    "//third_party/bounds_checking_function/include",
74  ]
75
76  deps = [ "//foundation/communication/bluetooth_service/services/bluetooth/ipc:btipc_static" ]
77
78  if (is_standard_system) {
79    external_deps = [
80      "hdf_core:libhdf_host",
81      "hdf_core:libhdf_ipc_adapter",
82      "hdf_core:libhdf_utils",
83      "hdf_core:libhdi",
84      "hilog:libhilog",
85    ]
86  } else {
87    external_deps = [ "hilog:libhilog" ]
88  }
89  external_deps += [
90    "c_utils:utils",
91    "hitrace:hitrace_meter",
92    "ipc:ipc_single",
93    "samgr:samgr_proxy",
94  ]
95
96  public_configs = [ ":hdi_audio_config" ]
97  version_script = "libhdi_audio_bluetooth_version_script.txt"
98  install_images = [ chipset_base_dir ]
99  subsystem_name = "hdf"
100  part_name = "drivers_peripheral_bluetooth"
101}
102