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
18config("hdi_service_config") {
19  visibility = [ ":*" ]
20
21  cflags = [
22    "-Wall",
23    "-Wextra",
24    "-Werror",
25    "-DGST_DISABLE_DEPRECATED",
26    "-DHAVE_CONFIG_H",
27    "-fno-strict-aliasing",
28    "-Wno-builtin-requires-header",
29    "-Wno-int-conversion",
30    "-Wno-unused-parameter",
31    "-Wno-thread-safety-attributes",
32    "-Wno-inconsistent-missing-override",
33    "-fno-rtti",
34    "-fno-exceptions",
35    "-ffunction-sections",
36    "-fdata-sections",
37  ]
38
39  ldflags = [ "-Wl" ]
40}
41
42ohos_shared_library("audio_bluetooth_hdi_adapter_server") {
43  include_dirs = [
44    "//drivers/peripheral/bluetooth/audio/interfaces/include",
45    "//drivers/peripheral/bluetooth/audio/hal/hdi_passthrough/include",
46    "//drivers/peripheral/bluetooth/audio/hal/hdi_binder/server/include",
47    "//third_party/bounds_checking_function/include",
48  ]
49
50  sources = [
51    "src/hdf_audio_server.cpp",
52    "src/hdf_audio_server_common.cpp",
53    "src/hdf_audio_server_render.cpp",
54  ]
55
56  deps = [ "//drivers/peripheral/bluetooth/audio/hal/hdi_passthrough:hdi_audio_bluetooth" ]
57
58  defines = []
59  if (is_standard_system) {
60    external_deps = [
61      "hdf_core:libhdf_host",
62      "hdf_core:libhdf_ipc_adapter",
63      "hdf_core:libhdf_utils",
64      "hdf_core:libhdi",
65      "hilog:libhilog",
66    ]
67  } else {
68    external_deps = [ "hilog:libhilog" ]
69  }
70  external_deps += [ "c_utils:utils" ]
71
72  public_configs = [ ":hdi_service_config" ]
73
74  shlib_type = "hdi"
75  install_images = [ chipset_base_dir ]
76  subsystem_name = "hdf"
77  part_name = "drivers_peripheral_bluetooth"
78}
79