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 integer_overflow = true 30 ubsan = true 31 boundary_sanitize = true 32 } 33 public_configs = [ ":audio_utils_public_config" ] 34 install_enable = true 35 include_dirs = [ 36 "./include", 37 "../../../interfaces/inner_api/native/audiocommon/include/", 38 "../../../services/audio_service/client/include", 39 ] 40 41 sources = [ 42 "./src/audio_channel_blend.cpp", 43 "./src/audio_performance_monitor.cpp", 44 "./src/audio_speed.cpp", 45 "./src/audio_utils.cpp", 46 "./src/dfx_stat.cpp", 47 "./src/dfx_utils.cpp", 48 "./src/volume_ramp.cpp", 49 ] 50 51 public_external_deps = [ "bounds_checking_function:libsec_shared" ] 52 53 external_deps = [ 54 "access_token:libaccesstoken_sdk", 55 "access_token:libprivacy_sdk", 56 "access_token:libtokenid_sdk", 57 "bundle_framework:appexecfwk_core", 58 "c_utils:utils", 59 "hicollie:libhicollie", 60 "hilog:libhilog", 61 "hitrace:hitrace_meter", 62 "init:libbegetutil", 63 "ipc:ipc_single", 64 "media_foundation:media_monitor_client", 65 "media_foundation:media_monitor_common", 66 "samgr:samgr_proxy", 67 ] 68 69 if (sonic_enable == true) { 70 external_deps += [ "pulseaudio:sonic" ] 71 } 72 73 defines = [] 74 if (audio_framework_feature_hitrace_enable) { 75 defines += [ "FEATURE_HITRACE_METER" ] 76 external_deps += [ "hitrace:hitrace_meter" ] 77 } 78 79 if (build_variant == "user") { 80 defines += [ "AUDIO_BUILD_VARIANT_USER" ] 81 } else if (build_variant == "root") { 82 defines += [ "AUDIO_BUILD_VARIANT_ROOT" ] 83 } 84 85 subsystem_name = "multimedia" 86 innerapi_tags = [ "platformsdk_indirect" ] 87 part_name = "audio_framework" 88} 89 90ohos_shared_library("audio_xml_utils") { 91 branch_protector_ret = "pac_ret" 92 sanitize = { 93 cfi = true 94 cfi_cross_dso = true 95 cfi_vcall_icall_only = true 96 debug = false 97 integer_overflow = true 98 ubsan = true 99 boundary_sanitize = true 100 } 101 public_configs = [ ":audio_utils_public_config" ] 102 install_enable = true 103 include_dirs = [ 104 "./include/audio_xml_parser.h", 105 "../../../interfaces/inner_api/native/audiocommon/include/", 106 ] 107 108 sources = [ "./src/audio_xml_parser.cpp" ] 109 110 public_external_deps = [ "libxml2:libxml2" ] 111 112 external_deps = [ "hilog:libhilog" ] 113 114 subsystem_name = "multimedia" 115 innerapi_tags = [ "platformsdk_indirect" ] 116 part_name = "audio_framework" 117} 118