1# Copyright (c) 2023-2024 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("../../../distributedaudio.gni") 16 17ohos_shared_library("libaudio_manager_daudio_primary_service_1.0") { 18 sanitize = { 19 boundary_sanitize = true 20 cfi = true 21 cfi_cross_dso = true 22 debug = false 23 integer_overflow = true 24 ubsan = true 25 } 26 include_dirs = [ 27 "${hdf_ser_aud_path}/include", 28 "${hdf_service_path}/hdi_service/common/include", 29 "${hdf_service_path}/hdi_service/common/log/include", 30 "${hdf_service_path}/hdi_service/common/utils/include", 31 ] 32 33 sources = [ 34 "./src/audio_adapter_interface_impl.cpp", 35 "./src/audio_capture_ext_impl.cpp", 36 "./src/audio_capture_interface_impl.cpp", 37 "./src/audio_manager_interface_impl.cpp", 38 "./src/audio_render_ext_impl.cpp", 39 "./src/audio_render_interface_impl.cpp", 40 ] 41 42 ldflags = [ 43 "-fpie", 44 "-Wl,-z,relro", 45 "-Wl,-z,now", 46 ] 47 48 public_deps = [ "${hdf_service_path}/hdi_service/common:libdaudio_hdf_utils" ] 49 50 external_deps = [ 51 "cJSON:cjson", 52 "c_utils:utils", 53 "drivers_interface_distributed_audio:libdaudio_stub_1.0", 54 "drivers_interface_distributed_audio:libdaudioext_stub_2.1", 55 "hdf_core:libhdf_host", 56 "hdf_core:libhdf_utils", 57 "hilog:libhilog", 58 "ipc:ipc_single", 59 "samgr:samgr_proxy", 60 ] 61 cflags = [] 62 if (drivers_peripheral_distributed_audio_extension) { 63 cflags += [ "-DDAUDIO_SUPPORT_EXTENSION" ] 64 } 65 66 if (drivers_peripheral_daudio_shared_buffer) { 67 cflags += [ "-DDAUDIO_SUPPORT_SHARED_BUFFER" ] 68 } 69 70 defines = [ 71 "HI_LOG_ENABLE", 72 "LOG_DOMAIN=0xD004130", 73 ] 74 75 if (build_variant == "root") { 76 defines += [ 77 "DUMP_CAPTURE_FILE", 78 "DUMP_RENDER_FILE", 79 ] 80 } 81 82 install_images = [ chipset_base_dir ] 83 subsystem_name = "hdf" 84 part_name = "drivers_peripheral_distributed_audio" 85} 86 87ohos_shared_library("libdaudio_primary_driver") { 88 sanitize = { 89 boundary_sanitize = true 90 cfi = true 91 cfi_cross_dso = true 92 debug = false 93 integer_overflow = true 94 ubsan = true 95 } 96 include_dirs = [ "${hdf_ser_aud_path}/include" ] 97 98 sources = [ "./src/audio_driver.cpp" ] 99 100 ldflags = [ 101 "-fpie", 102 "-Wl,-z,relro", 103 "-Wl,-z,now", 104 ] 105 106 deps = [ "${hdf_ser_aud_path}:libaudio_manager_daudio_primary_service_1.0" ] 107 108 external_deps = [ 109 "c_utils:utils", 110 "drivers_interface_distributed_audio:libdaudio_stub_1.0", 111 "drivers_interface_distributed_audio:libdaudioext_stub_2.1", 112 "hdf_core:libhdf_host", 113 "hdf_core:libhdf_ipc_adapter", 114 "hdf_core:libhdf_utils", 115 "hdf_core:libhdi", 116 "hilog:libhilog", 117 "ipc:ipc_single", 118 ] 119 120 shlib_type = "hdi" 121 install_images = [ chipset_base_dir ] 122 subsystem_name = "hdf" 123 part_name = "drivers_peripheral_distributed_audio" 124} 125 126group("hdf_daudio_primary_service") { 127 deps = [ 128 ":libaudio_manager_daudio_primary_service_1.0", 129 ":libdaudio_primary_driver", 130 ] 131} 132