• 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/adapter/uhdf2/uhdf.gni")
16import("//drivers/peripheral/audio/audio.gni")
17
18samgr_dir = "//foundation/distributedschedule/samgr"
19
20config("hdi_audio_config") {
21  visibility = [ ":*" ]
22
23  cflags = [
24    "-fPIC",
25    "-Wall",
26    "-Wextra",
27    "-Werror",
28    "-DGST_DISABLE_DEPRECATED",
29    "-DHAVE_CONFIG_H",
30    "-fno-strict-aliasing",
31    "-Wno-sign-compare",
32    "-Wno-builtin-requires-header",
33    "-Wno-implicit-function-declaration",
34    "-Wno-format",
35    "-Wno-int-conversion",
36    "-Wno-unused-function",
37    "-Wno-unused-parameter",
38    "-Wno-thread-safety-attributes",
39    "-Wno-inconsistent-missing-override",
40    "-fno-rtti",
41    "-fno-exceptions",
42    "-ffunction-sections",
43    "-fdata-sections",
44  ]
45
46  ldflags = [ "-Wl" ]
47}
48
49ohos_shared_library("hdi_audio_bluetooth") {
50  sources = [
51    "//third_party/cJSON/cJSON.c",
52    "src/audio_adapter.cpp",
53    "src/audio_adapter_info_common.cpp",
54    "src/audio_bluetooth_manager.cpp",
55    "src/audio_common.cpp",
56    "src/audio_manager.cpp",
57    "src/audio_render.cpp",
58    "src/bluetooth_a2dp_audio_src_observer_stub.cpp",
59    "src/bluetooth_a2dp_src_observer.cpp",
60  ]
61
62  include_dirs = [
63    "//drivers/peripheral/bluetooth/audio/hal/hdi_passthrough/include",
64    "//drivers/peripheral/bluetooth/audio/supportlibs/adm_adapter/include",
65    "//third_party/cJSON",
66    "//drivers/peripheral/bluetooth/audio/interfaces/include",
67    "//foundation/communication/bluetooth/services/bluetooth_standard/ipc/include",
68    "//foundation/communication/bluetooth/services/bluetooth_standard/common",
69    "//foundation/communication/bluetooth/interfaces/innerkits/native_cpp/include",
70    "//foundation/communication/bluetooth/interfaces/innerkits/native_cpp/framework/common",
71    "//foundation/communication/bluetooth/interfaces/innerkits/native_c/include",
72    "//third_party/bounds_checking_function/include",
73    "$hdf_uhdf_path/osal/include",
74    "$hdf_uhdf_path/common/include/core",
75  ]
76
77  deps = [
78    "$hdf_uhdf_path/hdi:libhdi",
79    "$hdf_uhdf_path/host:libhdf_host",
80    "$hdf_uhdf_path/ipc:libhdf_ipc_adapter",
81    "$hdf_uhdf_path/utils:libhdf_utils",
82    "${samgr_dir}/interfaces/innerkits/common:samgr_common",
83    "${samgr_dir}/interfaces/innerkits/lsamgr:lsamgr",
84    "${samgr_dir}/interfaces/innerkits/samgr_proxy:samgr_proxy",
85    "//foundation/communication/bluetooth/services/bluetooth_standard/ipc:btipc_static",
86    "//utils/native/base:utils",
87  ]
88
89  if (is_standard_system) {
90    external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
91  } else {
92    external_deps = [ "hilog:libhilog" ]
93  }
94  external_deps += [ "ipc:ipc_single" ]
95
96  public_configs = [ ":hdi_audio_config" ]
97
98  install_images = [ chipset_base_dir ]
99  subsystem_name = "hdf"
100  part_name = "bluetooth_device_driver"
101}
102