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("//build/test.gni") 16import("../../../config.gni") 17config("audio_clock_public_config") { 18 include_dirs = [ "./include" ] 19 20 cflags_cc = [ "-std=c++20" ] 21} 22 23ohos_shared_library("audio_clock") { 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 integer_overflow = true 31 ubsan = true 32 boundary_sanitize = true 33 } 34 public_configs = [ ":audio_clock_public_config" ] 35 install_enable = true 36 include_dirs = [ 37 "./include", 38 "../../../interfaces/inner_api/native/audiocommon/include/", 39 "../audioutils/include", 40 ] 41 42 deps = [ 43 "../audioutils:audio_utils" 44 ] 45 46 sources = [ 47 "./src/capturer_clock.cpp", 48 "./src/audio_source_clock.cpp", 49 "./src/capturer_clock_manager.cpp", 50 "./src/audio_primary_source_clock.cpp", 51 ] 52 53 public_external_deps = [ "bounds_checking_function:libsec_shared" ] 54 55 external_deps = [ 56 "c_utils:utils", 57 "hicollie:libhicollie", 58 "hilog:libhilog", 59 "init:libbegetutil", 60 "ipc:ipc_single", 61 "samgr:samgr_proxy", 62 ] 63 64 defines = [] 65 66 if (build_variant == "user") { 67 defines += [ "AUDIO_BUILD_VARIANT_USER" ] 68 } else if (build_variant == "root") { 69 defines += [ "AUDIO_BUILD_VARIANT_ROOT" ] 70 } 71 72 subsystem_name = "multimedia" 73 part_name = "audio_framework" 74} 75 76ohos_unittest("audioclock_unit_test") { 77 module_out_path = "audio_framework/audio_framework_route/audioclock" 78 79 cflags = [ 80 "-Wall", 81 "-Werror", 82 "-fno-access-control", 83 ] 84 85 include_dirs = [ 86 "./include", 87 "../../../interfaces/inner_api/native/audiocommon/include/", 88 "../audioutils/include", 89 ] 90 91 sources = [ 92 "test/unittest/audio_primary_source_clock_unit_test.cpp", 93 "test/unittest/audio_source_clock_unit_test.cpp", 94 "test/unittest/capturer_clock_manager_unit_test.cpp", 95 "test/unittest/capturer_clock_unit_test.cpp", 96 ] 97 98 deps = [ 99 ":audio_clock", 100 "../audioutils:audio_utils" 101 ] 102 103 defines = [] 104 105 external_deps = [ 106 "c_utils:utils", 107 "drivers_interface_audio:libaudio_proxy_5.0", 108 "googletest:gmock", 109 "googletest:gtest", 110 "ipc:ipc_single", 111 ] 112 113 part_name = "audio_framework" 114 subsystem_name = "multimedia" 115} 116