1# Copyright (C) 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("//foundation/multimedia/ringtone_library/ringtone_library.gni") 16 17config("ringtone_helper_public_config") { 18 visibility = [ ":*" ] 19} 20 21ohos_shared_library("ringtone_data_helper") { 22 branch_protector_ret = "pac_ret" 23 install_enable = true 24 25 include_dirs = [ 26 "${RINGTONE_SCANNER_PATH}/include", 27 "${RINGTONE_RESTORE_PATH}/include", 28 "${RINGTONE_EXTENSION_PATH}/include", 29 "${RINGTONE_DFX_PATH}/include", 30 "${RINGTONE_SERVICES_PATH}/utils/include", 31 "${RINGTONE_INTERFACES_PATH}/inner_api/native", 32 "${RINGTONE_HELPER_PATH}/include", 33 ] 34 35 sources = [ 36 "src/ringtone_asset.cpp", 37 "src/ringtone_fetch_result.cpp", 38 ] 39 40 public_configs = [ ":ringtone_helper_public_config" ] 41 42 cflags = [ 43 "-Wall", 44 "-Werror", 45 "-Wno-unused-but-set-variable", 46 "-fdata-sections", 47 "-ffunction-sections", 48 "-Os", 49 ] 50 51 cflags_cc = [ "-Os" ] 52 53 external_deps = [ 54 "ability_base:zuri", 55 "ability_runtime:abilitykit_native", 56 "app_file_service:sandbox_helper_native", 57 "c_utils:utils", 58 "common_event_service:cesfwk_innerkits", 59 "data_share:datashare_common", 60 "data_share:datashare_consumer", 61 "hilog:libhilog", 62 "hitrace:hitrace_meter", 63 "kv_store:distributeddata_inner", 64 "relational_store:native_rdb", 65 ] 66 67 if (!ringtone_link_opt) { 68 sanitize = { 69 cfi = true 70 cfi_cross_dso = true 71 debug = false 72 integer_overflow = true 73 ubsan = true 74 boundary_sanitize = true 75 } 76 } 77 78 subsystem_name = "multimedia" 79 part_name = "ringtone_library" 80} 81