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 18samgr_dir = "//foundation/systemabilitymgr/samgr" 19 20declare_args() { 21 bluetooth_a2dp_hdi = false 22} 23 24config("hdi_audio_config") { 25 visibility = [ ":*" ] 26 27 cflags = [ 28 "-fPIC", 29 "-Wall", 30 "-Wextra", 31 "-Werror", 32 "-DGST_DISABLE_DEPRECATED", 33 "-DHAVE_CONFIG_H", 34 "-fno-strict-aliasing", 35 "-Wno-builtin-requires-header", 36 "-Wno-int-conversion", 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 if (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 ] 65 66 include_dirs = [ 67 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 68 "//drivers/hdf_core/adapter/uhdf2/shared/include", 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 "//foundation/communication/bluetooth/services/bluetooth/ipc/include", 74 "//foundation/communication/bluetooth/services/bluetooth/common", 75 "//foundation/communication/bluetooth/interfaces/inner_api/include", 76 "//foundation/communication/bluetooth/frameworks/inner/common", 77 "//foundation/communication/bluetooth/interfaces/inner_api/include/c_header", 78 "//third_party/bounds_checking_function/include", 79 "$hdf_uhdf_path/osal/include", 80 "$hdf_uhdf_path/common/include/core", 81 ] 82 83 deps = [ 84 "$hdf_uhdf_path/utils:libhdf_utils", 85 "${samgr_dir}/interfaces/innerkits/samgr_proxy:samgr_proxy", 86 "//foundation/communication/bluetooth/services/bluetooth/ipc:btipc_static", 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 += [ 95 "c_utils:utils", 96 "ipc:ipc_single", 97 ] 98 99 public_configs = [ ":hdi_audio_config" ] 100 101 install_images = [ chipset_base_dir ] 102 subsystem_name = "hdf" 103 part_name = "drivers_peripheral_bluetooth" 104} 105