• 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  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  ]
43
44  ldflags = [ "-Wl" ]
45}
46
47ohos_shared_library("hdi_audio_bluetooth") {
48  if (bluetooth_a2dp_hdi) {
49    defines = [ "A2DP_HDI_SERVICE" ]
50  }
51
52  sources = [
53    "//third_party/cJSON/cJSON.c",
54    "src/audio_adapter.cpp",
55    "src/audio_adapter_info_common.cpp",
56    "src/audio_bluetooth_manager.cpp",
57    "src/audio_common.cpp",
58    "src/audio_manager.cpp",
59    "src/audio_render.cpp",
60    "src/bluetooth_a2dp_audio_src_observer_stub.cpp",
61    "src/bluetooth_a2dp_src_observer.cpp",
62  ]
63
64  include_dirs = [
65    "//drivers/peripheral/bluetooth/audio/hal/hdi_passthrough/include",
66    "//drivers/peripheral/bluetooth/audio/supportlibs/adm_adapter/include",
67    "//third_party/cJSON",
68    "//drivers/peripheral/bluetooth/audio/interfaces/include",
69    "//third_party/bounds_checking_function/include",
70  ]
71
72  deps = [ "//foundation/communication/bluetooth_service/services/bluetooth/ipc:btipc_static" ]
73
74  if (is_standard_system) {
75    external_deps = [
76      "hdf_core:libhdf_host",
77      "hdf_core:libhdf_ipc_adapter",
78      "hdf_core:libhdf_utils",
79      "hdf_core:libhdi",
80      "hilog:libhilog",
81    ]
82  } else {
83    external_deps = [ "hilog:libhilog" ]
84  }
85  external_deps += [
86    "c_utils:utils",
87    "ipc:ipc_single",
88    "samgr:samgr_proxy",
89  ]
90
91  public_configs = [ ":hdi_audio_config" ]
92
93  install_images = [ chipset_base_dir ]
94  subsystem_name = "hdf"
95  part_name = "drivers_peripheral_bluetooth"
96}
97