1# Copyright (c) 2025 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") 16import("//build/test.gni") 17config("audio_utils_public_config") { 18 include_dirs = [ "./include" ] 19 20 cflags_cc = [ "-std=c++20" ] 21} 22 23ohos_shared_library("audio_definitions") { 24 branch_protector_ret = "pac_ret" 25 sanitize = { 26 cfi = true 27 cfi_cross_dso = true 28 cfi_vcall_icall_only = true 29 debug = false 30 } 31 public_configs = [ ":audio_utils_public_config" ] 32 install_enable = true 33 include_dirs = [ 34 "./include", 35 "../../../frameworks/native/audioutils/include", 36 "../../../interfaces/inner_api/native/audiocommon/include", 37 "../../../services/audio_policy/common/include", 38 ] 39 40 deps = [ "../audioutils:audio_utils" ] 41 42 sources = [ 43 "../../../services/audio_policy/server/domain/device/src/audio_device_descriptor.cpp", 44 "./src/audio_pipe_info.cpp", 45 "./src/audio_stream_descriptor.cpp", 46 ] 47 48 public_external_deps = [ "bounds_checking_function:libsec_shared" ] 49 50 external_deps = [ 51 "c_utils:utils", 52 "hilog:libhilog", 53 "ipc:ipc_single", 54 ] 55 56 defines = [] 57 58 if (build_variant == "user") { 59 defines += [ "AUDIO_BUILD_VARIANT_USER" ] 60 } else if (build_variant == "root") { 61 defines += [ "AUDIO_BUILD_VARIANT_ROOT" ] 62 } 63 64 if (audio_framework_feature_detect_soundbox) { 65 defines += [ "DETECT_SOUNDBOX" ] 66 } 67 68 subsystem_name = "multimedia" 69 innerapi_tags = [ "platformsdk_indirect" ] 70 part_name = "audio_framework" 71} 72 73ohos_unittest("audio_definitions_unit_test") { 74 module_out_path = "audio_framework/audio_framework_route/audiodefinitions" 75 76 cflags = [ 77 "-Wall", 78 "-Werror", 79 "-fno-access-control", 80 ] 81 82 include_dirs = [ 83 "./include", 84 "../../../frameworks/native/audioutils/include", 85 "../../../interfaces/inner_api/native/audiocommon/include", 86 "../../../services/audio_policy/common/include", 87 ] 88 89 sources = [ 90 "test/unittest/audio_stream_descriptor_unit_test.cpp", 91 ] 92 93 deps = [ 94 ":audio_definitions", 95 "../audioutils:audio_utils" 96 ] 97 98 defines = [] 99 100 external_deps = [ 101 "googletest:gmock", 102 "googletest:gtest", 103 "hilog:libhilog", 104 "init:libbegetutil", 105 "c_utils:utils", 106 "hilog:libhilog", 107 "ipc:ipc_single", 108 ] 109} 110