1# Copyright (c) 2022 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("../../../config.gni") 16config("audio_utils_public_config") { 17 include_dirs = [ "./include" ] 18 19 cflags_cc = [ "-std=c++20" ] 20} 21 22ohos_shared_library("audio_utils") { 23 branch_protector_ret = "pac_ret" 24 sanitize = { 25 cfi = true 26 cfi_cross_dso = true 27 cfi_vcall_icall_only = true 28 debug = false 29 } 30 public_configs = [ ":audio_utils_public_config" ] 31 install_enable = true 32 include_dirs = [ 33 "./include", 34 "../../../interfaces/inner_api/native/audiocommon/include/", 35 "../../../services/audio_service/client/include", 36 ] 37 38 sources = [ 39 "./src/audio_channel_blend.cpp", 40 "./src/audio_speed.cpp", 41 "./src/audio_utils.cpp", 42 "./src/volume_ramp.cpp", 43 ] 44 45 public_external_deps = [ "bounds_checking_function:libsec_shared" ] 46 47 external_deps = [ 48 "access_token:libaccesstoken_sdk", 49 "access_token:libprivacy_sdk", 50 "access_token:libtokenid_sdk", 51 "c_utils:utils", 52 "hicollie:libhicollie", 53 "hilog:libhilog", 54 "hitrace:hitrace_meter", 55 "init:libbegetutil", 56 "ipc:ipc_single", 57 ] 58 59 if (sonic_enable == true) { 60 external_deps += [ "pulseaudio:sonic" ] 61 } 62 63 defines = [] 64 if (audio_framework_feature_hitrace_enable) { 65 defines += [ "FEATURE_HITRACE_METER" ] 66 external_deps += [ "hitrace:hitrace_meter" ] 67 } 68 69 if (build_variant == "user") { 70 defines += [ "AUDIO_BUILD_VARIANT_USER" ] 71 } else if (build_variant == "root") { 72 defines += [ "AUDIO_BUILD_VARIANT_ROOT" ] 73 } 74 75 subsystem_name = "multimedia" 76 innerapi_tags = [ "platformsdk_indirect" ] 77 part_name = "audio_framework" 78} 79