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") 15 16declare_args() { 17 drivers_peripheral_bluetooth_a2dp_hdi = false 18} 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-builtin-requires-header", 32 "-Wno-int-conversion", 33 "-Wno-unused-parameter", 34 "-Wno-thread-safety-attributes", 35 "-Wno-inconsistent-missing-override", 36 "-fno-rtti", 37 "-fno-exceptions", 38 "-ffunction-sections", 39 "-fdata-sections", 40 "-Oz", 41 "-flto", 42 ] 43 44 ldflags = [ "-Wl" ] 45} 46 47ohos_shared_library("hdi_audio_bluetooth") { 48 if (drivers_peripheral_bluetooth_a2dp_hdi) { 49 defines = [ "A2DP_HDI_SERVICE" ] 50 } 51 52 sources = [ 53 "src/audio_adapter.cpp", 54 "src/audio_adapter_info_common.cpp", 55 "src/audio_bluetooth_manager.cpp", 56 "src/audio_common.cpp", 57 "src/audio_manager.cpp", 58 "src/audio_render.cpp", 59 "src/bluetooth_a2dp_audio_src_observer_stub.cpp", 60 "src/bluetooth_a2dp_src_observer.cpp", 61 "src/fast_audio_render.cpp", 62 "src/audio_capture.cpp", 63 "src/audio_hearing_aid.cpp", 64 ] 65 66 include_dirs = [ 67 "//drivers/peripheral/bluetooth/audio/hal/hdi_passthrough/include", 68 "//drivers/peripheral/bluetooth/audio/supportlibs/adm_adapter/include", 69 ] 70 71 deps = [] 72 73 if (is_standard_system) { 74 external_deps = [ 75 "drivers_interface_bluetooth:hdi_audio_bluetooth_header", 76 "hdf_core:libhdf_host", 77 "hdf_core:libhdf_ipc_adapter", 78 "hdf_core:libhdf_utils", 79 "hdf_core:libhdi", 80 "hilog:libhilog", 81 "cJSON:cjson", 82 ] 83 } else { 84 external_deps = [ "hilog:libhilog" ] 85 } 86 external_deps += [ 87 "c_utils:utils", 88 "hitrace:hitrace_meter", 89 "ipc:ipc_single", 90 "samgr:samgr_proxy", 91 ] 92 93 if (!drivers_peripheral_bluetooth_a2dp_hdi) { 94 external_deps += [ 95 "bluetooth:btframework", 96 "bluetooth:btcommon", 97 ] 98 } 99 100 public_configs = [ ":hdi_audio_config" ] 101 version_script = "libhdi_audio_bluetooth_version_script.txt" 102 install_images = [ chipset_base_dir ] 103 subsystem_name = "hdf" 104 part_name = "drivers_peripheral_bluetooth" 105} 106